Docket Cache – Object Cache Accelerator


The Docket cache is a persistent WordPress Object Cache that is stored as a plain PHP code. Intends to provide an alternative option for those who can’t use Redis or Memcached server.

Rather than using serialize and unserialize a PHP object to store into flat files, this plugin stores data by converting the object into plain PHP code which results in faster data retrieval and better performance with Zend OPcache enabled.

Kindly refer to the WordPress documentation on Object Cache.

Why use this plugin?

When it comes to reliable persistent Object Cache in WordPress, Redis or Memcached comes on top. However, those solutions require knowledge of server and rarely available at low cost or shared hosting servers.

The only solution is to store the object caches into files. With WordPress, exporting the PHP objects are not easy, most plugin that implements file-based solution will serialize and unserialize the object to store and retrieve the data.

The Docket Cache is better because it converts the object cache into plain PHP code. This solution is faster since WordPress can use the cache directly without running other operation.


  • Object caching + OPcache
  • Advanced Post Caching
  • Object Cache Precaching
  • WordPress Translation Caching
  • Term Count Queries Optimization
  • Post, Page, Comment Count Optimization
  • Database Tables Optimization
  • WP Options Autoload suspension
  • Post Missed Schedule Tweaks
  • Cache Log
  • Cronbot Service
  • Multisite support


To use Docket Cache requires minimum:

  • PHP 7.2.5
  • WordPress 5.4
  • Zend OPcache

Configuration Options

To adjust the configuration, please refer to Configuration documentation for details.

WP-CLI Commands

To use the WP-CLI commands, please refer to WP-CLI documentation for available commands



  • Isometric graphic by upklyak/


  • Plugin Overview.
  • Cache Log.
  • Configuration.
  • Select log to view.
  • Cache view.


To use Docket Cache require minimum PHP 7.2.5, WordPress 5.4 and Zend OPcache for best performance.

  1. In your WordPress admin click Plugins -> Add New
  2. Search plugins “Docket Cache” and click Install Now.
  3. Click Activate or Network Activate in Multisite setups.
  4. Enable the object cache under Settings -> Docket Cache, or in Multisite setups under Network Admin -> Settings -> Docket Cache.


What is Object Caching in WordPress?

Object caching is a process that stores database query results in order to quickly bring them back up next time they are needed.

The cached object will be served promptly from the cache rather than sending multiple requests to a database. This is more efficient and reduces massive unnecessary loads on your server.

In simple terms, object caching allows objects that are used often to be copied and stored at a closer location for quicker use.

What is Docket Cache in Object Caching?

By default, the object cache in WordPress is non-persistent. This means that data stored in the cache reside in memory only and only for the duration of the request. Cached data will not be stored persistently across page loads. To make it persistent, the object cache must be stored on a local disk.

Docket Cache is not just stored the object cache, it converts the object cache into plain PHP code. This solution is faster since WordPress can use the cache directly without running other operation.

What is OPcache in Docket Cache?

OPcache is a caching engine built into PHP, improves performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request.

Docket Cache converts the object cache into plain PHP code. When read and write cache, it will use OPcache directly which results in faster data retrieval and better performance.

What’s the difference with the other object cache plugin?

Docket Cache is an Object Cache Accelerator. It does some optimization of caching like cache post queries, comments counting, WordPress translation and more before storing the object caches.

Can I pair using it with other cache plugin?

Yes and No. You can pair using it with page caching plugin, but not with the object cache plugin.


August 18, 2020
I finally found an Opcache plugin that works for WordPress Popular Posts plugin! WPP has a huge performance issue with on a high traffic site. It, therefore, has a caching system since version 4.2.0. However, that needs to have an in-memory data storage such as Redis or Memcached. The shared host server I'm using doesn't have either one. But WPP turns out to support Opcache as well (the official Wiki page doesn't mention it). Docket Cache works totally fine with the WPP cache function. Great plugin! Thank you!
July 27, 2020
Opcache is certainly one of the better PHP acceleration tools. But it is not the easiest to use in combination with WordPress. I do not trust all other cache techniques. Minimizing HTML, CSS and JS will sooner or later lead to unexpected problems with page views or JavaScripts works incorrectly. Also other page caching techniques are not always the best solutions. I always use local Windows IIS web server systems to prepare local test versions of websites. This great new Opcache WordPlugin also does the great job. Apparently finally a cross platform Opcache plugin that does the job! Thank you very much for the good work! 🙂
Read all 7 reviews

Contributors & Developers

“Docket Cache – Object Cache Accelerator” is open source software. The following people have contributed to this plugin.


“Docket Cache – Object Cache Accelerator” has been translated into 2 locales. Thank you to the translators for their contributions.

Translate “Docket Cache – Object Cache Accelerator” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



This is an enhanced version based on previous fix releases.

  • Fixed Object cache stats, counting using ajax worker and only run on the overview page.
  • Fixed Precaching, completely ignore query string and limit to 1000 urls.
  • Fixed Caching, maxttl always set to 0 to avoid unexpected behavior from others plugin.
  • Fixed Cronbot, bepart::is_ssl() check if site behind cloudflare/proxy.
  • Added Transient, Set the expiry time to 12 hours if expiration not set.
  • Added Garbage collector, scheduled to every 5 minutes instead of 30 minutes. Enable cronbot service if your site wp-cron not running active.
  • Added Object cache stats, enable/disable at configuration page.
  • Added DOCKET_CACHE_MAXFILES constant, attempting to reduce cache file if bigger than default 5000 files. Only numbers between 200 and 200000 are accepted.

Please do “Flush Cache” after/before installing this update. Thanks.


This is a hotfix release. Please do “Flush Cache” after/before installing this update. Thanks.

  • Fixed cache file grow quickly if enable advanced post cache, maxttl should always set to 0.


This is a hotfix release. Please do “Flush Cache” after/before installing this update. Thanks.

  • Fixed empty value return by constans->is_int, constans->is_array.


This is a hotfix release.

  • Fixed cache stats, do collecting data in background to avoid lagging.
  • Fixed cronbot, execute cron process directly without wp-cron.php, to avoid http connection error.
  • Added cache stats options, Enable/disable object cache stats at Overview page.


Fix release.

  • Fixed precaching, ignore query to avoid junk query string
  • Fixed cronbot, add locking to avoid multiple send in short period
  • Fixed cronbot, remove site url trailing slash
  • Fixed cache stats overview


Fix release.

  • Fixed precache “class not found”
  • Fixed cronbot send site url instead of main site url if multisite
  • Fixed cronbot recheck connection


New features and fix release.

  • Added Cronbot Service
  • Fixed precache overmissed
  • Fixed for security reason, exclude user group from cache log if WP_DEBUG false
  • Fixed cache_read() -> Registry::getClassReflector -> fatal error class not found
  • Fixed PostCache::setup_hooks() -> array_shift error byreference
  • Fixed get_proxy_ip() -> return bool instead of IP string
  • Fixed ajax worker -> cache preload, cache flush, log flush


New features and fix release.

  • Added Object Cache Precaching
  • Added Optimize Database Tables
  • Added Suspend WP Options Autoload
  • Added Post Missed Schedule Tweaks
  • Added OPcache reset
  • Added Cache/OPcache Statistics
  • Fixed Invalid variable at “maybe_recount_posts_for_term”
  • Fixed Checking if file at cachedir_flush, cache_size
  • Fixed Cache flush and Drop-in installation, return false if dir/file is not writable


This is an improved version based on previous releases.

  • Added WordPres Translation Caching
  • Added Optimization for Term Count Queries

Kindly refer to Github Repo for previous Changelog.

Please do manually remove wp-content/object-cache.php and wp-content/cache/docket-cache if an error occurs during updates. Thanks.