Page 1 of 1
Clearing image cache
Posted: Mon Aug 06, 2012 4:46 pm
by RICHARD RUTA
I am having the same problem as described in another post in Feb 2012. I am using the File Upload widget to upload images. All works well except the cached image continues to display. Renaming the images is not an option. Have there been any solutions for this problem in recent updates? Do you have another suggestion?
Thanks for all your help,
Richard
Re: Clearing image cache
Posted: Thu Aug 09, 2012 9:24 am
by David
Your web browser will cache image files during a session. If you close/re-open the browser, it should load the updated image.
This is just how a browser is designed, and in most cases the behavior is desirable in that performance is improved by it not having to fetch the same files over and over again.
If you want to force the browser to redownload the image each time, you'd have to make the request different.
This can be done without having to rename the files by appending a unique value as a URL parameter.
For example, like this:
/mydir/myfile.gif?r=XXXXXXXX
If you supply a different value for the URL parameter each time (using server timestamp is an easy way to do that). The browser should then see this as a separate request and fetch the file again.