Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Misc

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

 

 

Varnish misc RSS feed   Index | Next | Previous | View Threaded


elodieuse at gmail

Apr 5, 2012, 3:03 PM

Post #1 of 2 (575 views)
Permalink
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
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


thierry.magnien at sfr

Apr 6, 2012, 5:18 AM

Post #2 of 2 (545 views)
Permalink
RE: pragma no-cache HTML only with beresp.http.Pragma ? [In reply to]

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 [mailto:varnish-misc-bounces [at] varnish-cache] De la part de Élodie BOSSIER
Envoyé : vendredi 6 avril 2012 00:03
À : varnish-misc [at] varnish-cache
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
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

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

Varnish misc RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.