Skip to content Skip to sidebar Skip to footer

Reload A Cached Image With Javascript

is it possible to use javascript to reload a particular image that is has cached? On my site users can upload new avatars. After this is done, I want the browser to redownload the

Solution 1:

Maybe caching with ETag is a solution: http://en.wikipedia.org/wiki/HTTP_ETag

When a different users loads a page after the avatar update, the ETag he sends with the request for the image is different than the ETag generated on the server and should therefore result in a 200 response instead of a 304, so the image is reloaded.

Post a Comment for "Reload A Cached Image With Javascript"