Giter Site home page Giter Site logo

davereid-pfg / pantheon_advanced_page_cache Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pantheon-systems/pantheon_advanced_page_cache

0.0 0.0 0.0 132 KB

Drupal cache metadata + Pantheon's Global CDN

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

License: GNU General Public License v2.0

PHP 80.93% Gherkin 12.14% Shell 4.45% Dockerfile 2.48%

pantheon_advanced_page_cache's Introduction

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

Changing Listing Tags

Prior to the 1.2 release, this module would change the cache tags used on default listings. This changing of was done to make cache hits more likely but resulted in confusing cache clearing behavior. Sites that installed this module prior to 1.2 should uninstall and reinstall or run this command to update their settings.

terminus drush [MACHINE-NAME-OF-SITE].[ENV-NAME] -- config:set pantheon_advanced_page_cache.settings --input-format=yaml   "override_list_tags" "false"

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.