PRB: Browser Doesn't Show Most Recent Versions of .htm/.asp Files

ID: Q172896


The information in this article applies to:


SYMPTOMS

When using the Preview in Browser command on an .asp or .htm file, an older version of the file is seen, and the changes made seem to have been lost.


CAUSE

This is caused by the cache settings in the browser or the proxy server. If the browser is set to look only for cached versions, or if the proxy server is set to cache files, then the updated files will not be seen.


RESOLUTION

There are a few ways to work around this. From the user side, change the caching settings of the browser. To change this, click Options from the View menu, then click Advanced and "Temporary Internet Files - Settings." Select an option other than "Never." The page should then display correctly. To correct this from the server side, include the line "<% Response.Expires = 0 %>" at the top of the page in .asp files. This will keep any browser from displaying the cached version of the file. Note that this will work only for .asp files.

If there is a difference between the client and server time where the client time is earlier than the server time, use "<% Response.ExpiresAbsolute = [date] [time] %>" instead of the "<% Response.Expires = 0 %>" to indicate immediate expiration of the page.

If you are working through a proxy server, the following lines should keep most proxy servers from caching the page:


   <% Response.AddHeader "cache-control", "private" %>
   <% Response.AddHeader " pragma", "no-cache" %> 

An important caveat is that Internet Explorer will not look for a new version if the same file that is requested through Visual InterDev's Preview in Browser is the file that is currently displayed in the browser's window. Internet Explorer takes focus but does not look for a more recent version no matter what the Cache Settings are. Using the browser's "Refresh" button gets the new contents.


STATUS

This behavior is by design.


MORE INFORMATION

Steps to Reproduce Behavior

Preview an .asp or .htm file that has just been changed. The changes will not show up in the browser if the file is cached somewhere.


REFERENCES

For additional information, please see the following article in the Microsoft Knowledge Base:

Q172897 PRB: Link Repair Does Not Work Within HTML Layout Files

For the latest Knowledge Base articles and other support information on Visual InterDev and Active Server Pages, see the following page on the Microsoft Technical Support site:
http://support.microsoft.com/support/vinterdev/

Additional query words:


Keywords          : kbExtension kbFrontPage kbServer kbVisID100 kbWebServer kbGrpASP 
Version           : WINDOWS:1.0
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: July 13, 1999