Like somuch.com on Facebook Share somuch.com on Facebook somuch.com on Twitter Reddit LinkedIn Pinterest
Newest Tips & Tricks...

Home :: Tips & Tricks :: Active Server Pages

How can I force a no cache reload of every page?

http://www.tek-tips.com/faqs.cfm?fid=1034

<%
Response.Expires = 15
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "private"
%>

Just include it wherever I need it like this:

<!-- #include file="nocache.inc" -->

OR

<%
dim uUrl
uUrl = "uUrl=" & Date & Timer
%>
Example: Response.Redirect "somepage.asp?ID=1422&" & uUrl

Because the date and time change constantly, the above method will append a unique string to the end of every URL reference in your application. Thus, the browser will be unable to locate it in cache.

Source: http://www.tek-tips.com

Recommended Links...