Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Web
Expertise: Intermediate
Aug 27, 2001

How To Ensure That the Page is not Cached


Setting Response.Expires to a negative number or 0 disables caching. Sometimes, the use of Response.Expires = -1 doesn't work because of mismatches between the clocks on the server and the browsers. Be sure to use a large negative number, a little more than a day (1440), to work around those mismatches.

Example:
 
Response.Expire = -1441

Here are the commands to place at the top of your ASP scripts, to ensure that the page is not cached:
<% Response.Expires = 60 Response.Expiresabsolute = Now() - 1 Response.AddHeader "pragma","no-cache" Response.AddHeader "cache-control","private" Response.CacheControl = "no-cache" %>
Camelia Dediu
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date