Improve your WordPress SEO: Write better content and have a fully optimized WordPress site using the Yoast SEO…
About Pantheon Advanced Page Cache
Pantheon Advanced Page Cache is a plugin that helps WordPress sites improve their caching performance. It uses surrogate keys to accurately determine which parts of the cache need to be cleared when data is modified. This results in a higher cache hit rate and more efficient cache purging.Frequently asked questions
What is Pantheon Advanced Page Cache?
Pantheon Advanced Page Cache is a WordPress plugin designed to provide fine-grained control over how responses are represented in an edge cache. It uses surrogate keys to tag responses with identifiers based on the WordPress WP_Query object. This allows for a more accurate cache purge mechanism and generally higher cache hit rates.
How does Pantheon Advanced Page Cache work?
The plugin utilizes surrogate keys to "tag" responses with identifiers for the data used in the response. When WordPress data is modified, the plugin triggers a purge request for the corresponding surrogate keys. This ensures that related pages are automatically cleared from Pantheon's Edge when content is updated.
What are surrogate keys?
Surrogate keys are identifiers that tag responses, enabling flexible purging behavior. For example, a homepage response might include keys like "front," "home," and specific post or user IDs. These keys allow for targeted cache invalidation, such as clearing the cache for a post's URL, the homepage, and any index view the post appears on when a post is updated.
Does Pantheon Advanced Page Cache support the WordPress REST API?
Yes, Pantheon Advanced Page Cache works with the WordPress REST API. It can include surrogate keys for REST API requests, such as those for post collections, allowing for accurate cache purging of REST API endpoints.
What are the benefits of using Pantheon Advanced Page Cache?
The plugin offers a significantly more accurate cache purge mechanism and generally higher cache hit rates due to its surrogate key technology. This results in fresh content for visitors and high TTL (Time To Live) for cached pages, ensuring visitors never wait for updated content.
Changelog
2.1.1 (25 February 2025)
- Fixes 404 pages remaining cached after a post has been published (#315)
2.1.0 (8 August 2024)
- Adds any callable functions hooked to the
pantheon_cache_default_max_agefilter to the message that displays in the WordPress admin when a cache max age filter is active. [#292] This gives some context to troubleshoot if the filter is active somewhere in the codebase. If an anonymous function is used, it is noted in the message that displays. - Removes the hook to
nonce_lifeand replaces it with a new action (pantheon_cache_nonce_lifetime, see documentation). [#293] This was erroneously overriding any admin settings and setting the default cache max age for some sites to always be 23 hours (the nonce lifetime minus 1 hour). This solution requires that developers add thedo_actionwhen they are creating nonces on the front-end, but allows the cache settings to work as designed in all other instances.
2.0.0 (28 May 2024)
- Adds new admin alerts and Site Health tests about default cache max age settings and recommendations [#268, #271]. The default Pantheon GCDN cache max age value has been updated to 1 week in the Pantheon MU plugin. For more information, see the release note.
- Updated UI in Pantheon Page Cache admin page when used in a Pantheon environment (with the Pantheon MU plugin). [#272] This UI change takes effect when Pantheon MU plugin version 1.4.3 is available on your site.
- Automatically updates the cache max age to the recommended value (1 week) if it was saved at the old default value (600 seconds). [#269]
- Adds a hook into the
nonce_lifefilter when nonces are created on the front-end to set thepantheon_cache_default_max_ageto less than the nonce lifetime to avoid nonces expiring before the cache does. [#282] props @ryanshoover
1.5.0 (11 March 2024)
- Adds filter
pantheon_purge_post_type_ignoredto allow an array of post types to ignore before purging cache [#258] - Adds wpunit-helpers for running/setting up WP Unit tests
1.4.2 (October 16, 2023)
- Updates Pantheon WP Coding Standards to 2.0 [#249]
- Fixes an issue where a PHP warning was thrown when surrogate keys were emitted from archive pages with multiple post types. [#252]
1.4.1 (August 8, 2023)
- Send the REST API response header to the result and not the REST server [#237]. Props @srtfisher & @felixarntz.
1.4.0 (August 1, 2023)
- Bumped Dependencies [236]
- Add filter
pantheon_should_add_termsto allow disabling surrogate keys for posts’ taxonomy terms [239]
1.3.0 (April 19, 2023)
- Adds support for WordPress Multisite which resolves issue where editing a Post on one subsite clears the home page cache of other sites in the Multisite install if it has a Post containing the same ID [#228].
1.2.4 (April 13, 2023)
- Adds surrogate key to post-type archive pages (e.g. “portfolio”) that’s specific to that archive(e.g. “portfolio-archive”), and clears that archive where appropriate [#225].
1.2.3 (April 5, 2023)
- Bump tested up to version to 6.2
1.2.2 (March 14, 2023)
1.2.1 (February 23, 2023)
- Handle models that are not instances of the
WPGraphQLModelModelclass [#212]. - Make dependabot target develop branch [#209].
- Bump dependencies [#210] [#214].
1.2.0 (November 29, 2022)
- Adds Github Actions for building tag and deploying to wp.org. Add CONTRIBUTING.md. [#203]
1.1.0 (November 1, 2022)
- Hook into WPGraphQL to emit surrogate keys [#199].
- Add Plugin Integrations section to README
1.0.0 (March 2, 2020)
- Plugin is stable.
0.3.1 (October 27th, 2019)
0.3.0 (November 27th, 2017)
- Emits ‘404’ surrogate key on 404s; purges when purging the homepage [#107].
- Adds more specific filters for modifying surrogate keys in different contexts [#109].
- Cleans up codebase according to WordPress Coding Standards [#110, #116].
0.2.1 (October 25th, 2017)
- Ensures use of
?_embedemits correct surrogate keys [#103].
0.2.0 (August 10th, 2017)
- Automatically trims large lists of surrogate keys that break Nginx and Varnish limits for header size.
0.1.5 (May 24th, 2017)
- Disables emitting surrogate keys for the admin, unless explicitly added by filter.
0.1.4 (March 7th, 2017)
- Emits
feedsurrogate key for RSS feeds, and purges when posts are created, modified, or deleted.
0.1.3 (March 1st, 2017)
- Prevents error notices by only accessing
$rest_baseproperty of post types and taxonomies when set.
0.1.2 (December 6th, 2016)
- Permits admins to flush cache for a specific page if the
delete_others_postscapability has been deleted.
0.1.1 (November 30th, 2016)
- Drops settings UI in favor of including it in Pantheon’s WordPress upstream.
0.1.0 (November 23rd, 2016)
- Initial release.
