homepage Welcome to WebmasterWorld Guest from 54.234.0.85
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
HTML code to deny cache of .asp webpages
cccc




msg:3851316
 9:03 am on Feb 17, 2009 (gmt 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" ?

 

mattur




msg:3851441
 1:18 pm on Feb 17, 2009 (gmt 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"
%>

cccc




msg:3853606
 12:55 am on Feb 20, 2009 (gmt 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.

cccc




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

is this code correct?

cccc




msg:3855424
 9:51 pm on Feb 22, 2009 (gmt 0)

could someone explain pls, what exactly private and must-revalidate means?

mattglet




msg:3856967
 8:40 pm on Feb 24, 2009 (gmt 0)

[w3.org...]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved