March 19, 2013

WP APC Panel Plugin – Manage APC Cache in WordPress Admin

bitewp @ 12:46 am

You probably know the notorious apc.php in PECL APC package if you like fast loading web pages (who doesn’t?) and using APC opcode cache. Beside opcode cache, there is the option to use APC user cache as WordPress object cache, which would decrease database queries and also quicken inner working of WordPress. There is a great and de-facto plugin for doing that, named APC Object Cache Backend. It’s a drop-in plugin, the kind that you don’t activate via Plugins menu but drop plugin file into wp-contents directory.

WP APC Panel Plugin

Anyway, apc.php is a standalone script that shows files in opcode cache, key/values in user cache and general cache stats and graphs. Opcode and user cache can also be flushed separately via the apc.php. So it’s a simple but useful tool which you would like to have under your hand to see how the cache is doing. Is it working effectively? You want to delete that particular key/value (yes, it can delete individual key/values also)? Want to see if it has cached the correct results from that API request (also does that)? My answers to those questions were yes and thought it would be handy to being able to access apc.php under WordPress admin. So I make it compatible with WordPress, then packed as a plugin, which becomes WP APC Panel. Now I’m installing it on every site uses APC.

Also if you’re using Batcache plugin with APC instead of memcached, (which is a good decision if the site running on a single server), you can reset page cache with a single click on “Clear User Cache” button. Or you can restart the apache. Or restart the server. Or… just call apc_clear_cache(‘user’) function from somewhere, yeah, but it’s comfortable to do via WP APC Panel. I just had to make it work with WordPress, so thanks to the team created the PECL extension and the apc.php. But it wasn’t a quick job to make it work with WP, so I would like to hear your feedback! :)

Download the plugin here

Installation, regular stuff:

Upload WP APC Panel to your wordpress site, or install it via New Plugin page then activate it. You will find WP APC Panel item under Tools menu. Start watching cache hits crunching.

  • Guest

    Hi, I installed WP APC Panel with WP 3.5.1 running on a vps Litespeed Webserver. I also installed object-cache.php in the wp-content folder. The cache uptime is always 0 to 1 min. Is that normal?

  • karen ratte

    How do I find information on actually reading this data?

    • whitewp

      If you mean how you can utilize APC key/value cache within WordPress, it’s really straightforward. wp_cache_get/wp_cache_set functions do all the magic. If you mean reading/browsing the object cache via plugin, then “User Cache Entries” tab is what you’re looking for. I hope I got you right. :)