Welcome to WebmasterWorld Guest from 184.72.177.182

Forum Moderators: ocean10000

Message Too Old, No Replies

HTML code to deny cache of .asp webpages

     
9:03 am on Feb 17, 2009 (gmt 0)

New User

10+ Year Member

joined:Jan 12, 2004
posts: 37
votes: 0


hi

how should be the HTML code on the webserver to deny cache of .asp webpages?

is this correct?


<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />

but what are differencies between "pragma" and "Cache-Control" ?

1:18 pm on Feb 17, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 29, 2002
posts:980
votes: 0


Setting the headers is more reliable than using meta tags: see How (and how not) to control caches [mnot.net]

Meta tags are easy to use, but arenít very effective. Thatís because theyíre only honored by a few browser caches (which actually read the HTML), not proxy caches (which almost never read the HTML in the document). While it may be tempting to put a Pragma: no-cache meta tag into a Web page, it wonít necessarily cause it to be kept fresh.

Here's example ASP code from ASPFAQ [classicasp.aspfaq.com]


<%
Response.ExpiresAbsolute = #2000-01-01#
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", "private, no-cache, must-revalidate"
%>
12:55 am on Feb 20, 2009 (gmt 0)

New User

10+ Year Member

joined:Jan 12, 2004
posts: 37
votes: 0


thanks a lot!

I'll try this code:


Response.Expires = 0
Response.ExpiresAbsolute = 0
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "cache-control", "no-store"
Response.AddHeader "cache-control", "private, no-cache, must-revalidate"

to prevent any kind of caching.

5:30 pm on Feb 22, 2009 (gmt 0)

New User

10+ Year Member

joined:Jan 12, 2004
posts: 37
votes: 0


is this code correct?
9:51 pm on Feb 22, 2009 (gmt 0)

New User

10+ Year Member

joined:Jan 12, 2004
posts: 37
votes: 0


could someone explain pls, what exactly private and must-revalidate means?
8:40 pm on Feb 24, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 12, 2002
posts:1482
votes: 0


[w3.org...]
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members