I thought I’d put a quick post here in the hope that I save someone a bit of frustration.
I was testing a new Drupal 7 site and I noticed that while the static files (JS, CSS, images, etc.) were all showing the proper cache lifetime, the nodes themselves were being sent back with a max-age=0, causing a reverse proxy cache miss on eminently-cacheable content. A bit of digging turned up the culprit: the mostly-hidden variable ‘page_cache_invoke_hooks’.
When running Drupal 7 behind a Varnish reverse proxy cache, make sure to include the following lines (suitably edited) in your settings.php:
Continue reading ‘Drupal 7 & Varnish’