Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Address Fragment Caching? #8

Open
joshkoenig opened this issue Jan 15, 2016 · 1 comment
Open

How to Address Fragment Caching? #8

joshkoenig opened this issue Jan 15, 2016 · 1 comment

Comments

@joshkoenig
Copy link
Member

One piece of valuable feedback is we should address Fragment caching as an important topic. Good references:

https://www.tollmanz.com/partial-page-templating-in-wordpress/

https://markjaquith.wordpress.com/2013/04/26/fragment-caching-in-wordpress/

The question is how to address this given that fragments could be approached as an "internal" cache (in the DB or object cache) or "externally" via ESI.

Either way, we should have a strong opinion on this.

From @westonruter:

We cache fragments in the object cache in addition to using ESI for externally embedding dynamic partials. I suppose these two fragment cache strategies are two solutions that depend on whether the fragment is intended to be cached longer than the containing page, or whether the containing page would be cached longer than the fragment.

  • Use ESI when the fragment needs to be updated more frequently than the TTL for the cached page.
  • Use object cache to store output buffering of a fragment when the fragment has a TTL higher than that of the cached page, or if the fragment's cache has no TTL but is flushed in response to some event.

That might be how I decide between the two fragment caching strategies, with the ESI approach being more appropriate when discussing page caching, and the object cache approach being more appropriate when discussing object caching. (Naturally, ESI-served fragment cache can also be flushed in response to an event, but you have to know the endpoint URL to flush in Varnish.)

@joshkoenig joshkoenig changed the title Address Fragment Caching How to Address Fragment Caching? Jan 16, 2016
@westonruter
Copy link
Contributor

On Pantheon, see also https://pantheon.io/blog/esi-support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants