{"id":165801,"date":"2022-12-06T22:46:32","date_gmt":"2022-12-06T22:46:32","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/sqlite-object-cache\/"},"modified":"2026-03-23T09:58:18","modified_gmt":"2026-03-23T09:58:18","slug":"sqlite-object-cache","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/sqlite-object-cache\/","author":9099428,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.6.3","stable_tag":"1.6.3","tested":"7.0","requires":"5.5","requires_php":"5.6","requires_plugins":null,"header_name":"SQLite Object Cache","header_author":"Oliver Jones","header_description":"A persistent object cache backend powered by SQLite3.","assets_banners_color":"5a5049","last_updated":"2026-03-23 09:58:18","external_support_url":"","external_repository_url":"https:\/\/github.com\/OllieJones\/sqlite-object-cache","donate_link":"https:\/\/github.com\/sponsors\/OllieJones","header_plugin_uri":"https:\/\/github.com\/OllieJones\/sqlite-object-cache","header_author_uri":"https:\/\/github.com\/OllieJones\/","rating":5,"author_block_rating":0,"active_installs":9000,"downloads":121560,"num_ratings":49,"support_threads":2,"support_threads_resolved":2,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"0.1.7":{"tag":"0.1.7","author":"OllieJones","date":"2022-12-06 22:46:16"},"1.0.0":{"tag":"1.0.0","author":"OllieJones","date":"2023-01-10 19:55:25"},"1.1.0":{"tag":"1.1.0","author":"OllieJones","date":"2023-01-20 14:07:02"},"1.1.1":{"tag":"1.1.1","author":"OllieJones","date":"2023-01-23 22:22:58"},"1.2.0":{"tag":"1.2.0","author":"OllieJones","date":"2023-02-03 20:53:47"},"1.2.1":{"tag":"1.2.1","author":"OllieJones","date":"2023-02-15 15:06:22"},"1.2.2":{"tag":"1.2.2","author":"OllieJones","date":"2023-02-22 14:23:42"},"1.2.3":{"tag":"1.2.3","author":"OllieJones","date":"2023-03-16 17:33:03"},"1.3.0":{"tag":"1.3.0","author":"OllieJones","date":"2023-04-27 11:12:48"},"1.3.1":{"tag":"1.3.1","author":"OllieJones","date":"2023-05-08 13:30:39"},"1.3.2":{"tag":"1.3.2","author":"OllieJones","date":"2023-05-30 15:42:01"},"1.3.4":{"tag":"1.3.4","author":"OllieJones","date":"2023-06-07 12:42:23"},"1.3.5":{"tag":"1.3.5","author":"OllieJones","date":"2023-10-25 13:39:26"},"1.3.6":{"tag":"1.3.6","author":"OllieJones","date":"2023-12-05 11:29:31"},"1.3.7":{"tag":"1.3.7","author":"OllieJones","date":"2023-12-11 15:34:33"},"1.3.8":{"tag":"1.3.8","author":"OllieJones","date":"2024-10-28 17:53:12"},"1.4.0":{"tag":"1.4.0","author":"OllieJones","date":"2025-01-27 15:41:09"},"1.4.1":{"tag":"1.4.1","author":"OllieJones","date":"2025-02-14 19:31:22"},"1.5.1":{"tag":"1.5.1","author":"OllieJones","date":"2025-02-25 14:22:30"},"1.5.4":{"tag":"1.5.4","author":"OllieJones","date":"2025-03-12 16:31:24"},"1.5.5":{"tag":"1.5.5","author":"OllieJones","date":"2025-04-09 20:51:31"},"1.5.6":{"tag":"1.5.6","author":"OllieJones","date":"2025-04-17 14:13:09"},"1.5.7":{"tag":"1.5.7","author":"OllieJones","date":"2025-10-05 22:24:29"},"1.6.0":{"tag":"1.6.0","author":"OllieJones","date":"2025-11-26 18:30:18"},"1.6.1":{"tag":"1.6.1","author":"OllieJones","date":"2026-01-26 18:26:56"},"1.6.2":{"tag":"1.6.2","author":"OllieJones","date":"2026-03-18 13:50:26"},"1.6.3":{"tag":"1.6.3","author":"OllieJones","date":"2026-03-23 09:58:18"}},"upgrade_notice":{"":"

Correct a race condition upon cache item expiration. Improve SQLite3 checkpointing to reduce the probability of huge WAL files. Add a health check for OPcache (not APCu) exhaustion.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":49},"assets_icons":{"icon-128x128.jpg":{"filename":"icon-128x128.jpg","revision":2829632,"resolution":"128x128","location":"assets","locale":""}},"assets_banners":{"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":2829632,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1.7","1.0.0","1.1.0","1.1.1","1.2.0","1.2.1","1.2.2","1.2.3","1.3.0","1.3.1","1.3.2","1.3.4","1.3.5","1.3.6","1.3.7","1.3.8","1.4.0","1.4.1","1.5.1","1.5.4","1.5.5","1.5.6","1.5.7","1.6.0","1.6.1","1.6.2","1.6.3"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3254906,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3246505,"resolution":"2","location":"assets","locale":""}},"screenshots":{"1":"Settings panel. Access it with Settings > Object Cache.","2":"Performance statistics panel."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[7915,146,7913,247,28201],"plugin_category":[52,54],"plugin_contributors":[86923],"plugin_business_model":[216239],"class_list":["post-165801","plugin","type-plugin","status-publish","hentry","plugin_tags-apcu","plugin_tags-cache","plugin_tags-object-cache","plugin_tags-performance","plugin_tags-sqlite","plugin_category-performance","plugin_category-security-and-spam-protection","plugin_contributors-olliejones","plugin_business_model-community","plugin_committers-olliejones"],"banners":{"banner":"https:\/\/ps.w.org\/sqlite-object-cache\/assets\/banner-772x250.jpg?rev=2829632","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/sqlite-object-cache\/assets\/icon-128x128.jpg?rev=2829632","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/sqlite-object-cache\/assets\/screenshot-1.png?rev=3254906","caption":"Settings panel. Access it with Settings > Object Cache."},{"src":"https:\/\/ps.w.org\/sqlite-object-cache\/assets\/screenshot-2.png?rev=3246505","caption":"Performance statistics panel."}],"raw_content":"\n

A persistent object cache<\/a> helps your site perform well. This one uses the widely available SQLite3<\/a> extension, and optionally the igbinary<\/a> and APCu<\/a> extensions to php. Many hosting services offer those extensions, and they are easy to install on a server you control.<\/p>\n\n

What is this about?<\/h4>\n\n

It's about making your site's web server perform better. An object cache does that by reducing the workload on your MariaDB or MySQL database. This is not a page cache<\/a>; these persistent objects go into a different kind of cache. These objects aren't chunks of web pages ready for people to view in their browsers, they are data objects for use by the WordPress software.<\/p>\n\n

Caches<\/a> are ubiquitous in computing, and WordPress has its own caching subsystem. Caches contain short-term copies of the results of expensive database lookups or computations, and allow software to use the copy rather than repeating the expensive operation. This plugin (like other object-caching plugins) extends WordPress's caching subsystem to save those short-term copies from page view to page view. WordPress's cache happens to be a memoization<\/a> cache.<\/p>\n\n

Without a persistent object cache, every WordPress page view must use your MariaDB or MySQL database server to retrieve everything about your site. When a user requests a page, WordPress starts from scratch and loads everything it needs from your database server. Only then can it deliver content to your user. With a persistent object cache, WordPress immediately loads much of the information it needs. This lightens the load on your database server and delivers content to your users faster.<\/p>\n\n

Who should use this?<\/h4>\n\n

If your site runs on a single web server machine, and that server provides the SQLite3<\/a> and igbinary<\/a> extensions to php, this plugin will almost certainly make your site work faster. And if that server provides the APCu<\/a> extension, this plugin uses it too.<\/p>\n\n

Some hosting providers offer redis<\/a> cache servers. If your provider offers redis, it may be a good choice. You can use it via the Redis Object Cache<\/a> plugin. Sites using redis have one SQL database and another non-SQL storage server: redis. Other hosting providers offer memcached<\/a>, which has the Memcached Object Cache<\/a> plugin. And some large multipurpose cache plugins, such as the LiteSpeed Cache<\/a>, also offer object caching based on one of those cache server software packages.<\/p>\n\n

The cache-server approach to object caching comes into its own when you have multiple load-balanced web server machines handling your site. SQLite doesn't work correctly in a multiple-web-server environment.<\/p>\n\n

But, for single-server site configurations, SQLite, possibly assisted by APCu, performs well. And the vast majority of sites are single-server.<\/p>\n\n

APCu<\/h4>\n\n

APCu<\/a> is an in-memory storage medium. It lets php programs, like WordPress, store data in shared memory so it's very fast to retrieve when needed. If APCu is available on your host server, you can configure this plugin to use it. It reduces the typical cache lookup time to one-fifth or less of the SQLite lookup time, which is itself a few tens of microseconds. Performance counts, especially on busy web sites.<\/p>\n\n

Please look at Installation<\/a> to learn how to configure this plugin to use APCu. The plugin works fast without it, and faster with it.<\/p>\n\n

WP-CLI: Even if APCu is in use, caching with SQLite is necessary when your web site uses WP-CLI, because WP-CLI programs do not have access to the APCu cache. This plugin writes all cached data both to APCu and to SQLite and makes sure the two are synchronized.<\/p>\n\n

WP-CLI<\/h4>\n\n

You can control this plugin via WP-CLI once you activate it. Please type this command into your shell for details.<\/p>\n\n

wp help sqlite-object-cache\n<\/code><\/pre>\n\n

Credits<\/h4>\n\n

Thanks to Till Kr\u00fcss<\/a>. His Redis Object Cache<\/a> plugin serves as a model for this one. And thanks to Ari Stathopoulos<\/a> and Jonny Harris<\/a> for reviewing this. Props to Matt Jones for finding and fixing a bug that appeared on a heavily loaded system. Thanks to Massimo Villa<\/a> for testing help, and to nickchomey<\/a> for a comprehensive code review. All defects are, of course, entirely the author's responsibility.<\/p>\n\n

And thanks to Jetbrains for the use of their software development tools, especially PhpStorm<\/a>. It's hard to imagine how a plugin like this one could be developed without PhpStorm's tools for exploring epic code bases like WordPress's.<\/p>\n\n

How can I learn more about making my WordPress site more efficient?<\/h4>\n\n

We offer several plugins to help with your site's database efficiency. You can read about them here<\/a>.<\/p>\n\n\n

For this plugin to work for you, your server must<\/em> have the SQLite3<\/a> extension to php installed.<\/p>\n\n

If you have the igbinary<\/a> and APCu<\/a> extensions, this plugin uses them to work more efficiently. But it works without them.<\/p>\n\n

Installing \"SQLite Object Cache\" can be done either by searching for \"SQLite Object Cache\" via the \"Plugins > Add New\" screen in your WordPress dashboard, or by using the following steps:<\/p>\n\n

    \n
  1. Download the plugin via WordPress.org<\/li>\n
  2. Upload the ZIP file through the 'Plugins > Add New > Upload' screen in your WordPress dashboard<\/li>\n
  3. Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>\n\n

    Or, use these WP-CLI commands to install the plugin, secure it, activate it, and set the cache size to 32MiB.<\/p>\n\n

    wp plugin install sqlite-object-cache\nwp config set WP_CACHE_KEY_SALT $(openssl rand -base64 12)\nwp plugin activate sqlite-object-cache\nwp sqlite-object-cache size 32\n<\/code><\/pre>\n\n

    The plugin offers a few optional settings for your wp-config.php<\/code> file. Do not change them while the plugin is activated. If you change them, deactivate the plugin first, then change them, then reactivate the plugin.<\/p>\n\n