Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to clear a user's browser of my page, or say not to use cache?

Is there a command in classic ASP I can use to tell the browser not to pull the page from it's cache, or, to not cache, or clear the cache of my page?

like image 234
Brettski Avatar asked Dec 30 '22 10:12

Brettski


2 Answers

You can use HTML meta tags:

<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="Fri, 01 Jan 1999 1:00:00 GMT" />
<meta http-equiv="Last-Modified" content="0" />
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />

Or you can use ASP response headers:

<% 
   Response.CacheControl = "no-cache"
   Response.AddHeader "Pragma", "no-cache"
   Response.Expires = -1
%>
like image 190
Forgotten Semicolon Avatar answered Jan 01 '23 23:01

Forgotten Semicolon


Not asp related, this is a HTTP question. You do it by modifying some aspect of http caching like Cache-Control, etag, Expires etc. Read RFC2616 especially Caching in HTTP and set the appropriate header.

like image 42
Florian Bösch Avatar answered Jan 02 '23 00:01

Florian Bösch