Skip to content

Conversation

@jazzsequence
Copy link
Contributor

@jazzsequence jazzsequence commented Apr 19, 2024

Summary

Dependencies and Timing

Release:

  • When ready
  • After date: $DATE

Post Launch

Do not remove - To be completed by the docs team upon merge:

  • Redirect /old-path/ => /new-path/ (if applicable)
  • Include/exclude pages ^ respectively within docs search service provider (if applicable)

@jazzsequence jazzsequence requested review from a team as code owners April 19, 2024 20:46
@pantheon-decoupled
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8953-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@pantheon-decoupled
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8953-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@pantheon-decoupled
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8953-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@jazzsequence jazzsequence dismissed scottbuscemi’s stale review April 22, 2024 23:41

changes made, ready for re-review

@pantheon-decoupled
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8953-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@rachelwhitton
Copy link
Member

@rachelwhitton rachelwhitton added the Source: Pantheor Contribution from within Pantheon, unspecified team label Apr 23, 2024
@pantheon-decoupled
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8953-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@pantheon-decoupled
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8953-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

Copy link
Contributor

@stevector stevector left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jazzsequence @scottbuscemi I made some comments here on "TTL" vs. "max-age" but I'm not sure if that's a linguistic battle worth fighting since we have TTL all over the place. What do you think?

@rachelwhitton
Copy link
Member

Could we also audit the following doc for accuracy and update the WP tab to suggest using the new filter pantheon_skip_cache_control instead of the existing PHP snippet?

Bypassing Cache with HTTP Headers

@pantheon-decoupled
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8953-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@jazzsequence
Copy link
Contributor Author

jazzsequence commented Apr 24, 2024

@rachelwhitton The original code snippet isn't wrong. There is a perhaps small but significant difference in the approach between the two methods. The new filter returns no cache-control headers at all if you use add_filter( 'pantheon_skip_cache_control', '__return_true' ) on specific pages/paths. The documentation in the example sends the cache control headers with max-age=0. I think the end result is likely the same and this might be a good opportunity to show off the new filter in documentation, but it does not remove the complicated part (IMO the regex) and using the filter is not necessarily more correct (for my money, I might rather send max-age=0 than nothing).

I guess my question is, is it worth adding more code snippets to suggest using the filter as an alternative to what's currently there, but not remove it?

@stevector
Copy link
Contributor

I think the end result is likely the same

In some automated testing of caching a few years ago we found that it was possible to get cache hits from responses with a max-age=0 header. Right now I'm struggling to remember why I was in a position to discover that. But yeah, setting max-age=0 is not enough without no-cache (and must-revalidate??)

The original code snippet isn't wrong.

This strikes me as a situation where the Diátaxis documentation framework should help. Is the documentation here a tutorial, explanation, guide, or reference? I think this "bypassing cache" page is closest to a "How-To Guide." My expectation is that people come to this page in the context of attempting to accomplish a specific work task and they need the necessary steps to accomplish the task of bypassing cache for a real website (different from a general tutorial that's teaching caching concepts).

As a "How to Guide" it is acceptable to include "if" statements.

* If you want to ensure that the CDN does not cache the response do XYZ
* If you want to set a very specific cache header on your own and you want to Pantheon's plugin to set no header, the do ABC

I guess my question is, is it worth adding more code snippets to suggest using the filter as an alternative to what's currently there, but not remove it?

We run the risk of supplying the reader with too many options and not enough guidance on how to pick an option.

@pantheon-decoupled
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8953-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@jazzsequence
Copy link
Contributor Author

I guess my question is, is it worth adding more code snippets to suggest using the filter as an alternative to what's currently there, but not remove it?

We run the risk of supplying the reader with too many options and not enough guidance on how to pick an option.

Yeah, I tend to feel the same. I think it's fine to leave the existing snippet for now. I'd like to see how the filter is used in the wild anyway. We have documentation for the filter in the mu-plugin repository and we can publish some of that same documentation in the pantheon-advanced-page-cache plugin readme when we update that later this quarter.

@jazzsequence jazzsequence dismissed stevector’s stale review April 25, 2024 00:33

replaced TTL with max age throughout

@jazzsequence jazzsequence requested a review from stevector April 25, 2024 00:33
@jazzsequence jazzsequence changed the title [CMSP-993] New default cache TTL changes [CMSP-993 CMSP-1055] New default cache TTL changes Apr 25, 2024
@pantheon-decoupled
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8953-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@jazzsequence
Copy link
Contributor Author

1.4.0 of the mu-plugin has been released. https://github.com/pantheon-systems/pantheon-mu-plugin/releases/tag/1.4.0
Can I get a final review and ✅ before merging this?

@pantheon-decoupled
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8953-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@scottbuscemi
Copy link
Contributor

@stevector Any chance for a review so we can merge this in?

Copy link
Contributor

@stevector stevector left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woo! Thanks for the updates @scottbuscemi and @jazzsequence.

Shall I merge now?

@scottbuscemi
Copy link
Contributor

@jazzsequence Should we wait until the next WP release? Otherwise the docs won't match customer experience.

@stevector
Copy link
Contributor

Should we wait until the next WP release? Otherwise the docs won't match customer experience.

@scottbuscemi Probably? Could we take a few minutes to diagram out the interrelated parts and when we take which actions? That could be valuable internally and maybe more so externally. Like, I could interview you and @jazzsequence about the moving pieces in play (like https://www.youtube.com/watch?v=6pDMf9e3ZNM) There's value and trust-building in making visible how we handle these sorts of interrelated updates.

@scottbuscemi
Copy link
Contributor

Let's indeed hold off until the next WP release since that's when it'll be update-able for most customers.

@jazzsequence jazzsequence merged commit 5fa5dd4 into main May 7, 2024
@jazzsequence jazzsequence deleted the CMSP-993-new-cache-ttl-changes branch May 7, 2024 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Source: Pantheor Contribution from within Pantheon, unspecified team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants