Supress caching in ASP3.0

Caching is hard to manipulate, (is it o bug or not at the end and due to several factors I won't discuss now) you need to add several lines on the client and server side (although this won't eleminate the problem 100% but will minimise it a lot)
<%..
Response.expires= 0
Response.Expires=-1
Response.Expiresabsolute = Now() - 1
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<meta http-equiv="PRAGMA" value="NO-CACHE">
<meta http-equiv="Expires" content="Mon, 01 Jan 1990 12:00:00 GMT">


one of the best ways to suppress cache is to redirect to another page with  a querystring at the end
of the url like:

response.redirect "mynocachepage.asp?" & Server.URLEncode(rnd)

For more information see:

   http://www.activeserverpages.com/learn/cachenomore.asp

Published Tue, Feb 7 2006 10:18 by Michel SAKR
Filed under: , ,

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: