One scenario I'm running into is a particular path being invalidated more often than expected.

Say the page is at http://mysite.com/foo

and

curl -I -H "Pantheon-Debug:1" http://mysite.com/foo

returns

cache-control: public, max-age=31536000
surrogate-key-raw: block:views.one_example block:views.another_example node:123 node:456 node:789 taxonomy_vocabulary:11 taxonomy_vocabulary:12 taxonomy_vocabulary:13

In this example I'm expecting the node tags listed to be invalidated at most weekly (say there's a cron job running that updates nodes of that type once a week), however the age: of the /foo page in Pantheon's varnish is never observed to be older than 24 hrs. This leads me to believe that one of the other tags e.g block:views.another_example is causing the invalidation, but it's not obvious which one.

Ultimately I'd like to ask the question "which tag/event caused the latest invalidation at /foo"? Then I could look at why the tag is being added to the page, and if it could be omitted, and/or if some other process (e.g. a daily cron job adds terms to taxonomy_vocabulary:11) is creating a hard limit on how long the page can be cached.

My idea so far on how to build it involves setting some variable (maybe an array of cache tags for the page of interest) and then in an invalidate hook check if the tag being invalidated is one of interest, and if so log it.

Any feedback is much appreciated!

Comments

michfuer created an issue.