Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keep Page from Caching

Status
Not open for further replies.

saw15

Technical User
Jan 24, 2001
468
US
Good day,

Working with multiple asp pages, I need to know the best way to keep a page from caching to the browser.

New to asp so any type of example would be very helpful.

Thanks in advance.
 
Hi saweens

Here is a way to do it with all ASP
you can put this in a file and include it at the top of any page that you don't want to cache.

<%
Response.Expires = 15
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader &quot;pragma&quot;,&quot;no-cache&quot;
Response.AddHeader &quot;cache-control&quot;,&quot;private&quot;
Response.CacheControl = &quot;no-cache&quot;
%>

for what it is worth I believe I got this code from user vasah20.

Hope it helps you also.
 
It can also be put in a meta tag.
<meta http-equiv=&quot;pragma&quot; content=&quot;no-cache&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top