Caching of Web Pages can happen in separate entities in a Web environment. When you think about caching, you usually think about the Web pages cached locally in your temporary Internet files on your local machine as a result of having visited the page. But caching can also occur within a proxy server if it is present. This article describes how to prevent client browser caching and proxy caching.

Browser Caching

By default, the browser caches a visited Web page and stores it in the temporary Internet files of the profile that was used to log into the computer. If users of the browser do not want to be presented with cached pages when requested, they can define how the Internet browser will request content by following these steps:

For Internet Explorer 7.x

  1. Open Internet Explorer 7.x.
  2. From the Tools menu, click Internet Options.
  3. Click the General tab.
  4. Browsing history > Settings.
  5. Select "Every time I visit the webpage" for how often to check for newer versions of stored pages.

For FireFox 3.x.x

  1. Open FireFox 3.x.x.
  2. From the Tools menu, click Options.
  3. Click the Privacy tab.
  4. Uncheck "Keep my history for at least..."

But having all of your users do this is unreliable, and the above example describes only how to do this on one of many different browsers. To programmatically prevent a Web page from caching on the client, add the following line of code to the Meta section of your Web page:


Proxy Server Caching

To prevent the caching of Active Server Pages at the proxy server, add the following lines at the top of your .asp page:

   <% Response.cachecontrol="private" %> 

To Enable caching, add the following to your page:

   <% Response.cachecontrol="public" %>