Forced Image Refresh

P

Paul Johnson

I have a web site that allows users to upload images. The problem is when
an image is uploaded over the top of another image the user would have to
press F5 to refresh the images and clear the cashe. Is there anyway I can
automatically make the image refresh?

If that is not possible is there a way of making the whole page refresh
automatically?
 
C

Craig Deelsnyder

Paul said:
I have a web site that allows users to upload images. The problem is when
an image is uploaded over the top of another image the user would have to
press F5 to refresh the images and clear the cashe. Is there anyway I can
automatically make the image refresh?

If that is not possible is there a way of making the whole page refresh
automatically?

I always add a querystring arg to the image tag's src that is
time-dependent. For example, the UTC time on the server, which would
look something like this

http://mysite.com/image.aspx?uid=99123833 OR
http://mysite.com/image.gif?uid=99123833

that way the url that is given to the browser is always unique and
forces a new request to download it again.

Learned that from the old IE5 days, when that browser cached everything
it could and wouldn't react to HTTP expiration headers (or at least it
seemed it was way too difficult to figure out how to get things not to
cache).....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top