Requests for comment/Partial page caching

This is a request for comment about adding support for partial page caching (a.k.a. edge side includes). Please leave your comments below.

Proposal
Both Varnish and Squid support edge side includes (ESI). This proposal is to implement support for ESI within the MediaWiki software so that we can take advantage of this caching option where needed.

If implemented, Mediawiki could send out sections of a page like so:



This would allow the included content to be cached separately from the rest of the page. In other words, dynamic content could be included in a page without invalidating the cache of the rest of the page. This would let us do lots of cool things like:
 * Dynamically changing content based on the user's location
 * Dynamically changing content based on the user's browser (which would allow us to take advantage of more HTML5 features, as well as client-side SVG rendering)
 * Instant banner loading for CentralNotice
 * Partially cache pages for logged in users to optimize page loading

Bugzilla 

Comments
Copied from email: There's a lot of definite pluses there... I think Gabriel Wicke actually helped with some preliminary ESI work back in '04 or '05 that we never quite were ready to deploy, I don't know if any of that infrastructure is still around. --Brion Vibber

Copied from email: We've had this idea basically forever, but never really implemented it. Squid supports ESI. I think Gabriel Wicke (now on our staff) has played with it at the time... in 2004 or so? Anyway, Varnish supports ESI too, but allegedly it's limited. Artur Bergman/Wikia has played with it too, but not sure how far they got. Perhaps it's more feasible with current day MediaWiki too. --Mark Bergsma

I support the principle, but some planning would have to happen before people start haphazardly implementing this. There are pros and cons to using ESI that differ on a case-by-case basis, so I can only really comment in a useful way on specific proposals. --Catrope 09:55, 24 November 2011 (UTC)