The WinCache effect: Save with object caching

Reading Time: 2 Minutes

WinCache, or the Windows Cache Extension for PHP, is a PHP accelerator that is used to significantly increase the speed of PHP applications running on Windows Server IIS. Besides increasing the speed of PHP applications, WinCache decreases CPU usage making it a win win situation extension. I’ve described how to run PHP with WinCache on IIS in an earlier post.

This post is about WinCache’s advantages for WordPress on Windows Server IIS.

Advertisement:

Once you’ve set up and configured WinCache, it’s used by your IIS web server and PHP, increasing website speed and decreasing CPU usage. You can benchmark and measure its effect.

The PHP loading time and MySQL queries statistics in the footer of a WordPress site might show:

Stats: 31 queries in 0.914 seconds, running PHP version 7.0.4 & Wincache
Stats: 34 queries in 0.381 seconds, running PHP version 7.0.4 & Wincache
Stats: 31 queries in 0.162 seconds, running PHP version 7.0.4 & Wincache
Stats: 31 queries in 0.149 seconds, running PHP version 7.0.4 & Wincache

Pretty well, but still 31 queries for a vanilla WordPress site with only a few plugins.

To effectively use WinCache, there is a drop-in plugin available: WinCache Object Cache Backend. You can drop the object-cache.php file in your wp-content/ folder, to utilize WinCache’s object cache mode, a persistent memory-based backend for the WordPress object cache.

Now the statistics show:

Stats: 12 queries in 0.149 seconds, running PHP version 7.0.4 & Wincache
Stats: 12 queries in 0.125 seconds, running PHP version 7.0.4 & Wincache
Stats: 12 queries in 0.124 seconds, running PHP version 7.0.4 & Wincache
Stats: 12 queries in 0.126 seconds, running PHP version 7.0.4 & Wincache

WinCache’s object cache is where WordPress and WordPress plugins store the results of complex operations. On subsequent loads, the data can be fetched from the cache (memory), which will be much faster dan dynamically generating it on every page load. In this case, saving some 19 queries.

Note: this is an older post, moved from another blog of mine.


Advertisement:

Hi! Join the discussion, leave a reply!