I am tasked with improving page serving time for a rather big deployment of wordpress multisite.
I am considering using varnish for full page caching of content and using it's ESI abilities to include the dynamic content associated with the logged-in state of a user, also handling cache invalidation in the application by using varnish purge list that matche a custom header of the blog's id or some other custom headers containing article ids and/or user ids.
I'd like to know if anyone ever figured a way of including multiple page fragments through ESI while grouping them in a single response from the backend (eg. we must display the user's name in the menu and a custom user widget in the sidebar, the rest of the page is static and cached by varnish. ESI mandates that I make two requests to the backend in order to retrieve the two fragments and place them at their proper location while at the backend i could easily generate the HTML code for both in a single run and return it to varnish for processing)