kevcooper / pantheon_advanced_page_cache

Drupal cache metadata + Pantheon's Global CDN

Home Page:https://www.drupal.org/project/pantheon_advanced_page_cache

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pantheon Advanced Page Cache

CircleCI

Pantheon Advanced Page Cache module is a bridge between Drupal cache metadata and the Pantheon Global CDN.

Just by turning on this module your Drupal site will start emitting the HTTP headers necessary to make the Pantheon Global CDN aware of data underlying the response. Then, when the underlying data changes (nodes and taxonomy terms are updated, user permissions changed) this module will clear only the relevant pages from the edge cache.

This module has no configuration settings of its own, just enable it and it will pass along information already present in Drupal 8 to the Global CDN.

If you want to take finer grain control of how Drupal is handling it's cache data (in ways that will interact with both the Global CDN and internal Drupal caches) consider using Views Custom Cache Tags and Cache Control Override.

Debugging

By default, Pantheon's infrastructure strips out the Surrogate-Key response header before responses are served to clients. The contents of this header can be viewed as Surrogate-Key-Raw by adding on a debugging header to the request.

A direct way of inspecting headers is with curl -I. This command will make a request and show just the response headers. Adding -H "Pantheon-Debug:1" will result in Surrogate-Key-Raw being included in the response headers. The complete command looks like this:

curl -IH "Pantheon-Debug:1" https://dev-cache-tags-demo.pantheonsite.io/

Piping to grep will filter the output down to just the Surrogate-Key-Raw header:

curl -IH "Pantheon-Debug:1" https://dev-cache-tags-demo.pantheonsite.io/ | grep -i Surrogate-Key-Raw

Limit on header size

Pantheon's nginx configuration limits total header size to 32k. This module caps the Surrogate-Key at 25,000 bytes to minimize the chances that a very long Surrogate-Key header combines with other long headers to trigger a 502 error. This limit can be reached if your site renders thousands of entities in a single response. You will see warning messages in your log directing you to the issue queue if this limit is reached.

Feedback and collaboration

For real time discussion of the module find Pantheon developers in our Power Users Slack channel. Bug reports and feature requests should be posted in the drupal.org issue queue. For code changes, please submit pull requests against the GitHub repository rather than posting patches to drupal.org.

About

Drupal cache metadata + Pantheon's Global CDN

https://www.drupal.org/project/pantheon_advanced_page_cache

License:GNU General Public License v2.0


Languages

Language:PHP 82.5%Language:Gherkin 11.8%Language:Shell 3.0%Language:Dockerfile 2.8%