Hacker News new | past | comments | ask | show | jobs | submit login

It's been a few years since I worked on a large WP install but I wonder if you could write a plugin that replaced the comments section with an esi (edge side include) directive. That would allow Varnish to cache the whole page and then call into WP using the url in you esi include to build the comments section. You could also then set the ttl on esi comments url so that you can fragment cache the comments for non-logged in users (for say 10 seconds).

More info here: https://www.varnish-cache.org/trac/wiki/ESIfeatures




It's funny you should mention this. I was chatting to a mate about this thread and he suggested using an ESI approach.

I think it would work well if the Recent Comments widget was modified to spit a HTML fragment to predictably-named files that varnish could pick up and include with ESI.


I never installed Wordpress in production, this is the first time I hear about ESI and in general have almost no relevant experience, but maybe this suggestion has some worth:

ESI sounds like it would couple your web application code to your cache. This sounds negative to my ear. How about modifying the Recent Comments widget to work with an IFRAME or some AJAX? It adds another request to the server, but now both requests can be cached and compressed.


I wouldn't mind coupling Wordpress to Varnish, since I'm controlling my particular installation.

An ajax solution isn't a bad idea, though it would mean at least hitting PHP (whereas the Varnish option never gets that far).




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: