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 documentation on Caching In WordPress.

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
  • WordPress Core Query Optimisation
  • Term Count Queries Optimisation
  • Post, Page, Comment Count Optimisation
  • Database Tables Optimisation
  • WooCommerce Optimisation
  • WP Options Autoload suspension
  • Post Missed Schedule Tweaks
  • Object Cache + OPcache Stats
  • Cache Log
  • Cronbot Service
  • WP-CLI support
  • Multisite / Multi-Network support


To use Docket Cache requires minimum:

  • PHP 7.2.5
  • WordPress 5.4
  • Zend OPcache


To adjust the plugin behaviour, installation or manage through a command line, please refer to the Documentation for details.


Sponsor this project

There is a lot of room for improvement and features to add, require plenty of person-hours dedicated to testing and development.

Become our sponsor. All funds will be dedicated to maintenance, development, and marketing of this project.

Thank you for sponsoring Docket Cache.

Sponsored by:

A heartful thanks and appreciation.

Affiliates with:

By subscribing service using link one of the services below, you are indirectly sponsoring this project. We get a commission for every successful sale.

The Docket Cache has been reported seemly works with these hosting provider:


  • Overview.
  • Cache Log.
  • Cache view.
  • Cache content.
  • Cronbot.
  • Configuration.
  • Multisite / Multi-Network Overview.
  • Multisite / Multi-Network Cronbot.


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. Click Docket Cache in the left menu to access the admin page.

Please wait around 5 seconds for Docket Cache ready to cache the objects.


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 is the Cronbot Service in Docket Cache?

The Cronbot is an external service that pings your website every hour to keep WordPress Cron running actively. This service offered as an alternative option and is not compulsory to use. By default, this service not connected to the end-point server. You can completely disable it at the configuration page.

What is a RAM disk in Docket Cache?

A RAM disk is a representation of a hard disk using RAM resources, and it can take the form of a hardware device or a virtual disk.

Read and write speed on RAM is multiple times faster than SSD drives therefore storing Docket Cache files on a RAM disk greatly increases it’s performance.

Do note that creating RAM disks requires server administrative permission (root access) so this solution is not suitable for shared hosting servers.

This is an example command to create and use a RAM disk with Docket Cache:

$ cd wp-content/
$ sudo mount -t tmpfs -o size=500m tmpfs ./cache/docket-cache

To mount the cache path automatically on boot, you need to update your /etc/fstab file.

Please refer to the articles below about RAM disk:

  1. How to Easily Create RAM Disk
  2. What Is /dev/shm And Its Practical Usage
  3. Creating A Filesystem In RAM

To use it in Windows OS, create RAM Disk and change DOCKET_CACHE_PATH point to RAM Disk drive.

What is the minimum RAM required to use with shared hosting?

By default, WordPress allocates the memory limit to 256 MB. Combined with MySQL and Web Server, you need more than 256 MB. If you’re using a cheap hosting plan that allocates only 256 MB for totals usage. It is not enough, and Docket Cache can’t improve your website performance.

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

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.

I’m using a VPS server. Can I use Docket Cache to replace Redis?

Yes, you can. It can boost more your WordPress performance since there is no network connection need to makes and no worry about memory burst, cache-key conflict and error-prone caused by the improper settings.


October 28, 2020
Very fast cache! With other plugins that redis and memcached use, the problem was that writing to the storage was very slow, and reading was fast. That is, it loads very slowly at the first load, and at the next load, data is taken from the cache. This plugin does not affect the write performance, at the first load the speed is the same as if there were no persistent 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 8 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.



  • Fixed Tweaks::woocommerce_cart_fragments_remove() -> check if “wc-cart-fragments” script exists.
  • Fixed WP_Object_Cache::dc_precache_set -> ignore transient, site-transient.
  • Added Configuration Options -> Runtime Options.
  • Added Configuration Actions -> Config reset.
  • Added Configuration Actions -> Cleanup Post revisions, auto drafts, trash bin.
  • Added WP-CLI command -> runtime:install, runtime:reset.


  • Fixed Limit WP-Admin HTTP Requests -> invalid variable pagenow.
  • Fixed Cache Log -> use get_utc_offset() instead of date(‘T’).
  • Fixed Overview Actions -> rename admin/actcmd.php to admin/actions.php.
  • Fixed Cronbot Events -> display notice if failed to load EventList() .
  • Fixed nwdcx_throwable() -> only save data if WP_DEBUG defined .
  • Fixed Tweak::compat_notice() -> move to Plugin::compat_notice(), do check at CLI.
  • Fixed Plugin::get_subpage() -> add checking for adx variable.
  • Fixed OPcache flush -> lock for 20 seconds before accept new request.
  • Added Filesystem() methods -> sanitize_precache_maxfile, sanitize_maxsize, sanitize_maxsizedisk.


  • Fixed Auto-updates -> remove v20.11.05 workaround, had issue with opcache, enable/disable docket auto-updates only in docket cache -> configuration.
  • Fixed nwdcx_cleanuptransient() -> didn’t cleanup properly.
  • Added Configuration -> Limit WP-Admin HTTP Requests.

If you’re using Docket Cache v20.11.05 and below, please update to the latest version. Thanks.


  • Fixed Filesystem::cache_size() -> getsize stat failed.
  • Fixed Overview -> Object/WP OPcache Stats data empty called from worker.
  • Fixed Plugin::active() -> Randomly slow.
  • Added Configuration -> Flush OPcache On Deactivation.


  • Fixed Event::register() -> cron_schedules, merge if not exists.
  • Fixed ReqAction::screen_notice() -> missing cronbot executed events message.
  • Fixed WP_Hook -> use PHP_INT_MIN instead of -PHP_INT_MAX for earlier sequence.
  • Added WP_Object_Cache::dc_close() -> save precache after shutdown hooks.
  • Added WP_Object_Cache::dc_precache_load -> replace dc_precache_get().
  • Added Filesystem::close_buffer() -> close fastcgi request if no output buffer.


  • Fixed Plugin::get_opcache_status() -> Missing match pattern.
  • Fixed Plugin::register_plugin_hooks() -> Redundant loading, change plugin_loaded to plugins_loaded.
  • Fixed Filesystem::opcache_compile() -> Change filemtime early to 60 seconds. Opcache won’t compile if file newer than runtime.
  • Fixed WP_Object_Cache::dc_save() -> Remove change filemtime. Cache expiration now handles by timeout key.
  • Fixed Event::garbage_collector() -> Filemtime comparison with maxttl only applies to cache file without timeout or 0.
  • Fixed Event::register() -> Redundant loading, change plugin_loaded to plugins_loaded.
  • Fixed Dropino::multinet_install() -> Wrong flags for file_put_contents.


  • Fixed CronAgent::check_connection() -> close_ping() -> Invalid selfcheck delay. Set to 90 minutes instead of current time.
  • Fixed Auto-updates -> wp >= 5.5 can’t enable/disable auto-updates for docket cache at plugins page. Now, it should works vise-versa.
  • Fixed ReqAction -> Error notice undefined variable nv.


  • Fixed Admin Interface -> filter others admin notice using hook.
  • Fixed Event -> rare condition checkversion cronagent process lock timestamp no effect.
  • Fixed Event -> invalid remove event.
  • Fixed Actions -> when disable object cache, it will stay disabled until enable it back.
  • Fixed Notice -> only show compability notice at plugins, updates page and our overview page.
  • Added Constans() -> option to reload config at dc* methods.
  • Added Configuration -> deactivate WooCommerce Cart Fragments.
  • Added nwdcx_cleanuptransient -> makes it reuseable for Event::delete_expired_transients_db().


  • Fixed Admin Interface -> action notice can’t dismiss.
  • Fixed Admin Notice -> exclude Dismissible Notices Handler dnh_dismissed_notices option from cache.
  • Added Configuration -> remove the WordPress Application Passwords feature.


  • Fixed PostCache::setup_hooks() -> removed deprecated jetpack hook instagram_cache_oembed_api_response_body.


  • Added WP-CLI command -> run:gc, run:stats, run:cron, reset:lock, reset:cron, dropin:enable, dropin:disable, dropin:update, flush:precache
  • Fixed Admin Interface -> only show our own notice.

Kindly refer to changelog.txt for previous changes.

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