You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pantheon plugin is currently using max-age directive for setting cache duration. This is problematic when configuring long TTL, for example in combination with Pantheon Advanced Page Cache plugin.
With current implementation when long TTL is used the pages will be cached for given time in both CDN and user's browser. When content changes page is purged from CDN but user that visited it recently will still see version from their cache until TTL expires (which may be several days) or he hard reloads.
I think caching should be limited to CDN where it can be purged properly so s-maxage directive or Surrogate-Control header should be used.
The text was updated successfully, but these errors were encountered:
We've discussed this a bit internally before, and I agree. Would you be open to submitting a pull request? Clearly, pages should have some user agent cache lifetime still, but the bulk of the time should be CDN-only.
I generally prefer Surrogate-Control over s-maxage for this situation. That's for two reasons. First, Surrogate-Control providers richer and more isolated CDN vs. user agent control. Second, some Pantheon sites stack their CDN (use their own on top of the platform's own), and s-maxage would extend the long expiration into those CDNs, which are beyond our invalidation control.
Thanks for the response, I like your reasoning for Surrogate-Control. I may prepare PR at some point if this is not solved, but right now I'm quite busy.
Any updates on this issue? We have been talking about this independently and would love to see this added to the plugin rather than having to custom-patch our own site.
WordPress/wp-content/mu-plugins/pantheon/pantheon-page-cache.php
Line 278 in 215de66
WordPress/wp-content/mu-plugins/pantheon/pantheon-page-cache.php
Line 289 in 215de66
Pantheon plugin is currently using
max-age
directive for setting cache duration. This is problematic when configuring long TTL, for example in combination with Pantheon Advanced Page Cache plugin.With current implementation when long TTL is used the pages will be cached for given time in both CDN and user's browser. When content changes page is purged from CDN but user that visited it recently will still see version from their cache until TTL expires (which may be several days) or he hard reloads.
I think caching should be limited to CDN where it can be purged properly so
s-maxage
directive orSurrogate-Control
header should be used.The text was updated successfully, but these errors were encountered: