What is the best caching option for WordPress multi-site on non-shared hosting?

Basic answer to “what plugin” would probably be W3 Total Cache. It is one of the most functional and actively developed plugins at moment. However complete performance chain is much longer that WordPress plugin alone can handle. Web server (Apache or something else) configuration (response time, time to first byte, headers). Database (time spent processing … 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

Is this Solution for Caches vs Cookies Going to Get Me in Trouble?

Your solution with comment_author_proxyhash cookie will of course technically work – all caching plugins I know doesn’t analyze hash value and will just stop delivery of cached content based on comment_author_* cookie presense. Problem here is that page caching functionality is something websites really need and often page caching is configured exactly because naked WordPress … Read more

How does object caching work?

WordPress, by default, does a form of “Object Caching” but its lifetime is only a single page load. Options are actually a really good example of this. Check out this answer for more info. The summary: A page starts All options are loaded with a simple SELECT option_name, option_value from $wpdb->options statement Subsequent requests for … 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

Versioning @import of parent theme’s style.css

You don’t have to use @import. It’s best not to, actually. Using an enqueued approach is probably better all around. Here’s the relevant part of twentythirteen’s code: function twentythirteen_scripts_styles() { … // Loads our main stylesheet. wp_enqueue_style( ‘twentythirteen-style’, get_stylesheet_uri(), array(), ‘2013-07-18’ ); … } add_action( ‘wp_enqueue_scripts’, ‘twentythirteen_scripts_styles’ ); Here’s what you do in your code: … Read more

What are the best practices for using a caching plugin on a shared host?

On shared hosting plans your caching options are limited. You will only be able to statically cache the html output from your pages. This is the fastest way to serve pages but you loose the dynamic aspects of WordPress like making comments and seeing the latest comments on posts. There are disk caching options available … Read more

How do you avoid caching during development?

Add the filemtime() of your stylesheet as version parameter. Lets say, your default stylesheet is in css/default.css and css/default.min.css (not style.css). When we register a stylesheet on wp_loaded (not init), we can pass a version as fourth parameter. That will be the last modified time and therefore change every time we change the file. $min … Read more