pragma no-cache HTML only with beresp.http.Pragma ?

MAGNIEN, Thierry thierry.magnien at sfr.com
Fri Apr 6 14:18:12 CEST 2012


Hi,

Varnish deals with HTTP headers, not HTML content. The meta tags tell your browser not to cache the page, but if the web server does not add the corresponding HTTP headers in its response, varnish will have no clue about what to do, and  will apply the default TTL.

Regards,
Thierry

-----Message d'origine-----
De : varnish-misc-bounces at varnish-cache.org [mailto:varnish-misc-bounces at varnish-cache.org] De la part de Élodie BOSSIER
Envoyé : vendredi 6 avril 2012 00:03
À : varnish-misc at varnish-cache.org
Objet : pragma no-cache HTML only with beresp.http.Pragma ?

Greetings,

I would like take in consideration the cache information from a HTML 
page only, example this :

<html>
<head>
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
</head>
<body>
Hello world !
</body>
</html>

And this is a part of my default.vcl (only a debug part) :

sub vcl_fetch
   {
   if ( beresp.http.Pragma ~ "no-cache" )
     {
     set beresp.http.X-Cacheable = "found no-cache !";
     return(hit_for_pass);
     }

But it's don't work, it seem Varnish see only a header information (sent 
by PHP exemple), but nothing from a HTML page only.

Do you have an idea to take in consideration the HTML <head> with 
Varnish 3.0 please ?

Thanks so much,
Elodie.

_______________________________________________
varnish-misc mailing list
varnish-misc at varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc



More information about the varnish-misc mailing list