Forum Moderators: open

Message Too Old, No Replies

refreshing a page no-cache

         

northshore

4:58 pm on May 7, 2006 (gmt 0)

10+ Year Member



Hi,
This problem continually comes up with my clients - They ask me to do a change to thier website - i update some images - upload them and notify them the changes are complete - they check out the site - and they still see the old images -- yes i know -- all it takes is a simple click of the "refresh/reload" button and all is well - but my clients are completely computer illiterate - i have to email them back/call them -- with instructions on where and how to refresh their browser - when i make changes i usually just overwrite the old image with a new one - same name so i don't have to update all the html pages -- this is the caching issue -- is there a simple method to tell the browser right on the index page that this website has been updated and make it auto refresh the cache for the domain? I found this code:

ie: <META name="Expires" content="Tue, 01 Jun 1999 19:58:02 GMT">

Will this work? Can i just put in the time and date of my update and the browser will know to refresh? I'm unclear with the usage of this meta tag..
Thanks in advance..

mcvoid

5:07 pm on May 8, 2006 (gmt 0)

10+ Year Member



There is a way to force a refresh every time by putting a line in the header. I can't remember it off the top of my head. The "no-cache" part in the title is really close, though.

Can anybody back me up here? I'm feeling dumb.

Fotiman

5:33 pm on May 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Googling for preventing browser caching will give you the results you seek. Which are:

<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">

Note, these should be the first thing in your <head>. Also, a perferred method is to send these values in the actual HTTP headers, but that requires either some server side language (like ASP, PHP, etc.), or modifying the server configuration. There are drawbacks to preventing caching of the page as well, so you really should do some research. Google... you'll find what you need.