How can I use Varnish Edge Side includes for a sidebar?

You can do something like the following: If you have a sidebar called “Sidebar” <?php if ( !dynamic_sidebar(“Sidebar”) ) : endif; ?> You wrap it in ESI tags, one for if ESI is not enabled and one if it is: <esi:remove> <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(“Sidebar”) ) : endif; ?> </esi:remove> <!–esi <esi:include src=”https://wordpress.stackexchange.com/wp-content/plugins/myplugin/esihandler.php”/> … Read more

Varnish with WordPress

I gave it a punt and it seems to be OK. Below is my VCL. It basically unsets all cookies unless it’s wp-admin. This will only work for a very simple site. # Specific to my.website.com if (bereq.http.host == “my.website.com”) { # Strip all cookies (the only one should be PHPSESSID) if not admin if … Read more