Forum Moderators: open

Message Too Old, No Replies

Browser cache vs. updates

         

cuch

11:10 am on May 18, 2005 (gmt 0)

10+ Year Member



Hi, I'm a relatively new web designer and although I can build a good site, there's one thing that I can't sort out - when you've updated a site, is there a way to make sure the new version loads even if the previous version's cached in the user's browser? I've looked through resources but haven't found the solution yet. Can anyone answer it for me? Thanks...

Krapulator

3:57 am on May 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the user has the page cached on their machine, their browser will generally send an If-Modified-Since header when it requests the page.

A correctly configured server will send back either a 304 Not Modified (If the page has not been changed) or a 200 Found and the new version of the page (If the page has been updated since the specified date).

Thus if your server is doing everything right, the users should always see the newest version of the page. Although on occasion, you will get a user who has changed the settings on their browser to cache more aggresively. In this case theres not much you can do to override this because the browser won't even send a request to the server.

If you add the following meta tags to your pages, browsers will (probably) never cache them:

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

But be aware that this can have performace issues if your page sizes are large.

Reid

4:20 am on May 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



your pages are being cached all over the net.
ISP's are cacheing them even.
If a page is requested more than once in a certain time on some ISP's they will serve a cached version rather than fetch the page over and over, how about that? A page update could take months to update in all the places it's cached.
Don't fret about it.
Just dont be deleting any files because you will continue getting requests for that file for months.
I just put an explanation of the refresh button on my 'what's new' page.
generally if a page is updated then upon request (from your server) the cache will also be updated.

cuch

9:36 am on May 19, 2005 (gmt 0)

10+ Year Member



Thanks for those replies... Found the no-cache one before but as you said, I didn't want excessive wait time on larger pages. I won't fret, thanks =)