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

Mailing List Archive: Varnish: Misc

VCL question - where is cacheability determined?

 

 

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


meetheus at gmail

Jan 25, 2012, 9:19 AM

Post #1 of 1 (112 views)
Permalink
VCL question - where is cacheability determined?

I'm converting from 2.1 to 3.0. I got bit by the beresp.cacheable variable
going away, and replacing it with beresp.ttl > 0s doesn't work because ttl
hasn't been determined yet; it's a -1.000.

This is the block of code in question (in vcl_fetch)

if (!beresp.cacheable && beresp.status != 404) {
set beresp.http.X-Cacheable = "NO: !beresp.cacheable";
return (pass);
} else {
# From http://varnish-cache.org/wiki/VCLExampleLongerCaching
/* Remove Expires from backend, it's not long enough */
unset beresp.http.expires;
}

If beresp.ttl hasn't been determined yet, what's the appropriate
replacement?

On a related note, I was looking at the source code for 2.1. From my quick
reading, it looks like beresp.cacheable is determined by request type and
return status. I don't see where apache/drupal/web-server cache headers
are consulted at all.

Am I missing something there? Are back-end cache headers to be parsed in
VCL rather than being automagically determined?

TIA,

--- David

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.