homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

Keep page from being cached?
How do you keep a page from being cached on a visitor's PC?

10+ Year Member

Msg#: 4675 posted 8:05 am on Feb 13, 2004 (gmt 0)

I need to keep a particular page from being auto-cached on a user's PC. I have experienced that some visitors' computers are caching my pages, which isn't that big of a problem usually, but this particular page is an order form that changes frequently. Is there any meta code or otherwise to instruct the browser NOT to cache the page?

I'm not seeking to prevent someone from purposefully doing this, only to keep the browser from doing it automatically...?



WebmasterWorld Senior Member 10+ Year Member

Msg#: 4675 posted 12:44 pm on Feb 14, 2004 (gmt 0)

You could try these meta tags:

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

I've seen advises to put them at the end of the document as well, like this:

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

Can't guarantee that any of this works...


10+ Year Member

Msg#: 4675 posted 10:30 pm on Feb 14, 2004 (gmt 0)

This is difficult to do, even if you use HTTP or HTML headers to say that a file should not be cached, some browsers are configured to ignore this and cache it anyway. Then use the version from the cache for the current session, without checking the server to see if any changes have taken place.

One way to get around this is to trick the browser into thinking that the file is created by a script and could be different each time it is retrieved from the server. You can do that by adding a '?' to the end of the url.
For example

The webserver will ignore the '?' and still serve up the correct page.


WebmasterWorld Senior Member 10+ Year Member

Msg#: 4675 posted 8:26 am on Feb 16, 2004 (gmt 0)

There's a nice article about preventing caching at h*tp://www.web-caching.com/mnot_tutorial/how.html#CONTROL

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved