Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

Classic ASP - Prevent Cache from being stored

$
0
0
Hi everyone
 
Please find below the exact code you need in order to prevent cache from being stored. I am posting this in order to help everyone that ever needs it as I spent myself some hours this last saturday trying to do it. I saw many combinations from the same code everywhere in several forums but this is the only one that worked for me comes, as referenced below
 
After filling a form, then going back to the previous page and then forward back again, the form is empty as expected. Nothing is stored in the browser's cache
 
Hope it helps
 
Regards
 
Diego Sendra
e-mail: contact@diegosendra.com
http://www.diegosendra.com
 

[code]
<%
Response.buffer=true
Response.Expires = -1
Response.ExpiresAbsolute = Now() -1
Response.AddHeader "pragma", "no-store"
Response.AddHeader "cache-control","no-store, no-cache,
 
must-revalidate"
%>
[/code]

Viewing all articles
Browse latest Browse all 3938

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>