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

Nginx + WordPress + HHVM: Why isn’t Batcache working? Would Varnish help even more?

I guess the answer is that HHVM does not work with typical opcode caching, the compiler is not the same as “regular” PHP’s. HHVM has it’s own opcode caching that as far as I know does not integrate with APC or Zend’s OPcache, it does it’s own thing. In other words, it would be redundant. … Read more

Prevent WordPress from sending Cache-control http header

Thanks to @chrisguitarguy’s answer, you can control the http headers sent by WordPress via the “send_headers” hook. Here is the function I added to my theme’s functions.php file, and that solved the issue with the Varnish server. function varnish_safe_http_headers() { header( ‘X-UA-Compatible: IE=edge,chrome=1’ ); session_cache_limiter(”); header(“Cache-Control: public, s-maxage=120”); if( !session_id() ) { session_start(); } } … Read more