How to reload certain web images, but not from cache, in Django application? -


my django 1.62. application contains "show_members" view/template shows names , photos of members on site. catch have review each member's photo before allowing displayed on show_members page. therefore, when new member joins, display placeholder image until i've reviewed , approved photo. once that's done, real photo should displayed on page.

now use same name both placeholder image , real photo. allows me display either image on show_members page html:

<!-- part of show_members.html   placeholder , photo both named username_thumb.jpg --> <img src="{{ media_url }}photos/approved/{{ username }}/{{ username }}_thumb.jpg" /> 

the problem when new user first joins site, show_members template show placeholder image (from server) plus photos of other site members (usually client's browser cache) should. however, once i've approved new users photo, old placeholder image continue appear in client browser unless client's user forces refresh while bypassing cache.

is there way can programmatically force show_templates page repull new user's new approved photo server while still retrieving cached images other users? realize give different names placeholder image , approved photo , pass boolean template , use display 1 or other. however, seems rather inelegant solution. there customary way this?

thanks!

what can put query parameter after image cause cache reloaded :

<img src="{{ media_url }}photos/approved/{{ username }}/{{ username }}_thumb.jpg?v={{ username.updated_at }}" /> 

in example suppose have updated_at field correspond datetime of last update of model.


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -