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

Best way to show Dynamic Content on a Cached WordPress Site?

So, there are many sub-questions, i’ll try to address each. Views Counter Problem – I could make this Value/function be ran using Ajax. Once the new Cached/Static page is loaded, Javascript could then use Ajax to request and update the Views counter for that page. Totally agree: added benefit: loading it via ajax when “important” … Read more

Caching: APC vs APCu vs OPcache

The mix up is usually because these extensions are about two unrelated technologies: opcode caching and key-value data store. For WordPress you prefereably want both. Opcode caching is really the “normal” way to run PHP (and lack of it is essentially crippled shared hosting way). Data store can *(and should) be used by WordPress object … Read more

W3 total cache – cache refresh programmatically [closed]

if you want to flush the cache you can do that: the plugin has functions for that <?php flush_pgcache() //page cache flush_dbcache() // database cache flush_minify() // minify cache flush_all() //all caches ?> and you just need to call it like this: <?php $w3_plugin_totalcache->flush_all(); ?> and that is basically the answer to the question in … Read more