How override/remove cache headers from backend?

Espen Braastad espen at linpro.no
Wed Dec 3 16:30:27 CET 2008


Espen Braastad wrote:
> Hi,
>
> I'm having a bit of a problem with a not-so-trustworthy backend which is 
> sending the following headers:
>
> [...]
> Cache-Control: no-cache, no-store, max-age=0, must-revalidate
> Pragma: no-cache
> Vary: Accept-Encoding,Cookie
> [...]
>
> The goal is to get varnish to ignore/remove the headers and still put 
> the element into cache.
>   

The correct method (thanks to Lars Erler) is:

sub vcl_fetch {
  if(obj.ttl < 120s){
   set obj.ttl = 120s;
  }
}


-- 
Espen Braastad
Redpill Linpro AB - Changing the game
Kontor:  +47 21 54 41 37





More information about the varnish-misc mailing list