PDA

View Full Version : stop caching


crmpicco
06-07-2005, 06:46 PM
How do i stop my ASP page being cached on the clients Hard disc?

Freon22
06-07-2005, 07:08 PM
I work it both ways, always want to make sure the browser gets the message. :)
Also all of this you can get from a google search. Your asking the easy stuf again.


<%
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
%>

<!-- Start No cache Here -->
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
<!-- End Here -->

Morgoth
06-07-2005, 07:38 PM
That's perfect Freon22.

There is a problem using this code, but only if you use it on every page.

This code will make sure that your users will always have to download the page to see it. Very good for results being submited.
If you have large pictures, or something like that, your bandwidth can be used up really fast.

You might have already known that, but just keep that in mind. :o

Freon22
06-07-2005, 10:15 PM
I heard that with dot.net you can pick which parts of your page to cache. Guess some cool things are coming :D
But thanks for the tip, I'll remember that.