SQLite Object Cache
A persistent object cache helps your site perform well. This one uses the widely available SQLite3 extension, and optionally the igbinary and APCu extensions to php. Many hosting services offer those extensions, and they are easy to install on a server you control. What is this about? 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; 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. Caches 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 cache. 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. Who should use this? If your site runs on a single web server machine, and that server provides the SQLite3 and igbinary extensions to php, this plugin will almost certainly make your site work faster. And if that server provides the APCu extension, this plugin uses it too. Some hosting providers offer redis cache servers. If your provider offers redis, it may be a good choice. You can use it via the Redis Object Cache plugin. Sites using redis have one SQL database and another non-SQL storage server: redis. Other hosting providers offer memcached, which has the Memcached Object Cache plugin. And some large multipurpose cache plugins, such as the LiteSpeed Cache, also offer object caching based on one of those cache server software packages. 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. But, for single-server site configurations, SQLite, possibly assisted by APCu, performs well. And the vast majority of sites are single-server. APCu APCu 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. Please look at Installation to learn how to configure this plugin to use APCu. The plugin works fast without it, and faster with it. 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. WP-CLI You can control this plugin via WP-CLI once you activate it. Please type this command into your shell for details. wp help sqlite-object-cache Credits Thanks to Till Krüss. His Redis Object Cache plugin serves as a model for this one. And thanks to Ari Stathopoulos and Jonny Harris for reviewing this. Props to Matt Jones for finding and fixing a bug that appeared on a heavily loaded system. Thanks to Massimo Villa for testing help, and to nickchomey for a comprehensive code review. All defects are, of course, entirely the author’s responsibility. And thanks to Jetbrains for the use of their software development tools, especially PhpStorm. 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. How can I learn more about making my WordPress site more efficient? We offer several plugins to help with your site’s database efficiency. You can read about them here.
Top keywords
- cache17×2.27%
- server12×1.60%
- apcu10×1.33%
- site10×1.33%
- wordpress10×1.33%
- object9×1.20%
- database7×0.93%
- object cache7×0.93%
- redis6×0.80%
- web6×0.80%
- caching5×0.67%
- offer5×0.67%
StaticDelivr
StaticDelivr CDN is a lightweight and powerful plugin designed to improve your WordPress site’s performance. By rewriting theme, plugin, core file resource URLs, optimizing images, and proxying Google Fonts through the StaticDelivr CDN, the plugin ensures faster loading times, reduced server load, better privacy, and an improved user experience. StaticDelivr is a global content delivery network (CDN) that supports delivering assets from various platforms like npm, GitHub, and WordPress. By leveraging geographically distributed servers, StaticDelivr optimizes the delivery of your static assets such as CSS, JavaScript, images, and fonts. Key Features Smart Asset Detection: Automatically detects which themes and plugins are from wordpress.org and only serves those via CDN. Custom themes and plugins are served locally. No configuration needed! Failure Memory System: If a CDN resource fails to load, the plugin remembers and automatically serves it locally for 24 hours. No more repeated failures! Automatic URL Rewriting: Automatically rewrites URLs of enqueued styles, scripts, and core files for themes, plugins, and WordPress itself to use the StaticDelivr CDN. Image Optimization: Automatically optimizes images with compression and modern format conversion (WebP, AVIF). Turn 2MB images into 20KB without quality loss! Google Fonts Privacy Proxy: Serve Google Fonts without tracking (GDPR compliant). A drop-in replacement that strips all user-identifying data and tracking cookies. Automatic Fallback: If a CDN asset fails to load, the plugin automatically falls back to your origin server, ensuring your site never breaks. Localhost Detection: Automatically detects development environments and serves images locally when CDN cannot reach them. Child Theme Support: Intelligently handles child themes by checking parent theme availability on wordpress.org. Separate Controls: Enable or disable assets (CSS/JS), image optimization, and Google Fonts proxy independently. Quality & Format Settings: Customize image compression quality and output format. Verification Dashboard: See exactly which assets are served via CDN vs locally in the admin panel. Failure Statistics: View which resources have failed and are being served locally, with option to clear cache. Compatibility: Works seamlessly with all WordPress themes and plugins — both from wordpress.org and custom/premium sources. Improved Performance: Delivers assets from the StaticDelivr CDN for lightning-fast loading and enhanced user experience. Multi-CDN Support: Leverages multiple CDNs to ensure optimal availability and performance. Free and Open Source: Supports the open-source community by offering free access to a high-performance CDN. Use of Third-Party Service This plugin relies on the StaticDelivr CDN to deliver static assets, including WordPress themes, plugins, core files, optimized images, and Google Fonts. The CDN uses the public WordPress SVN repository to fetch theme/plugin files and serves them through a globally distributed network for faster performance and reduced bandwidth costs. Service Terms of Use: StaticDelivr Terms Privacy Policy: StaticDelivr Privacy Policy How It Works StaticDelivr CDN rewrites your WordPress asset URLs to deliver them through its high-performance network: Smart Asset Detection The plugin automatically verifies which themes and plugins exist on wordpress.org: WordPress.org Assets: Served via StaticDelivr CDN for maximum performance Custom/Premium Assets: Automatically detected and served from your server Child Themes: Parent theme is checked. If the parent is on wordpress.org, assets load via CDN This means the plugin “just works” with any combination of wordpress.org and custom themes/plugins! Failure Memory System (New in 1.7.0!) The plugin learns from CDN failures and automatically adapts: First failure: Fallback fires, failure is recorded Second failure: Resource is blocked from CDN for 24 hours Auto-recovery: After 24 hours, resources are retried automatically Manual reset: Clear the failure cache anytime from settings This ensures that problematic resources (Cloudflare-protected images, auth-gated content, etc.) are handled gracefully without repeated failures. Assets (CSS & JavaScript) Original URL: `https://example.com/wp-content/themes/theme-name/version/style.css` Rewritten CDN URL: `https://cdn.staticdelivr.com/wp/themes/theme-name/version/style.css` This process applies to themes, plugins, and core files: Themes: Original: `https://example.com/wp-content/themes/twentytwentythree/1.0/style.css` CDN: `https://cdn.staticdelivr.com/wp/themes/twentytwentythree/1.0/style.css` Plugins: Original: `https://example.com/wp-content/plugins/woocommerce/assets/js/frontend/woocommerce.min.js` CDN: `https://cdn.staticdelivr.com/wp/plugins/woocommerce/tags/9.3.3/assets/js/frontend/woocommerce.min.js` Core Files: Original: `https://example.com/wp-includes/js/jquery/jquery.min.js` CDN: `https://cdn.staticdelivr.com/wp/core/tags/6.9/wp-includes/js/jquery/jquery.min.js` Images Original: `https://example.com/wp-content/uploads/2024/01/photo.jpg` (2MB) Optimized CDN: `https://cdn.staticdelivr.com/img/images?url=https://example.com/wp-content/uploads/2024/01/photo.jpg&q=80&format=webp` (~20KB) Google Fonts Original CSS: `https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap` Privacy Proxy: `https://cdn.staticdelivr.com/gfonts/css2?family=Inter:wght@400;500;600&display=swap` Original Font Files: `https://fonts.gstatic.com/s/inter/v20/example.woff2` Privacy Proxy: `https://cdn.staticdelivr.com/gstatic-fonts/s/inter/v20/example.woff2` This ensures faster delivery through StaticDelivr’s globally distributed network while protecting user privacy. Why Use StaticDelivr? Zero Configuration: Smart detection means it works out of the box with any theme/plugin combination. Self-Healing: Failure memory system automatically adapts to problematic resources. Global Distribution: StaticDelivr serves your assets from a globally distributed network, reducing latency and improving load times. Massive Bandwidth Savings: Offload heavy image delivery to StaticDelivr. Optimized images can be 10-100x smaller! Privacy-First Google Fonts: Serve Google Fonts without tracking cookies — GDPR compliant without additional cookie banners. Works with Custom Themes: Unlike other CDN plugins, StaticDelivr automatically detects custom themes/plugins and serves them locally. Browser Caching Benefits: As an open-source CDN used by many sites, assets served by StaticDelivr are likely already cached in users’ browsers. This enables faster load times when visiting multiple sites using StaticDelivr. Significant Bandwidth Savings: Reduces your site’s bandwidth usage and number of requests significantly by offloading asset delivery to StaticDelivr. Optimized Performance: Ensures assets are delivered quickly, no matter where your users are located. Comprehensive WordPress Support: Includes support for delivering core WordPress files (e.g., those in the `wp-includes` directory) to enhance site speed and reliability. Support for Popular Platforms: Easily integrates with npm, GitHub, WordPress, and Google Fonts. Minimal Configuration: Just enable the features you want and the plugin handles the rest. Development Friendly: Automatically detects localhost and development environments. Translations StaticDelivr CDN is available in the following languages: English (default) Spanish (Español) – es_ES, es_MX French (Français) – fr_FR German (Deutsch) – de_DE Italian (Italiano) – it_IT Portuguese Brazil (Português) – pt_BR Dutch (Nederlands) – nl_NL Japanese (日本語) – ja Chinese Simplified (简体中文) – zh_CN Chinese Traditional (繁體中文) – zh_TW Russian (Русский) – ru_RU Arabic (العربية) – ar Korean (한국어) – ko_KR Turkish (Türkçe) – tr_TR Polish (Polski) – pl_PL Ukrainian (Українська) – uk Czech (Čeština) – cs_CZ Hungarian (Magyar) – hu_HU Romanian (Română) – ro_RO Swedish (Svenska) – sv_SE Danish (Dansk) – da_DK Finnish (Suomi) – fi Hebrew (עברית) – he_IL Persian (فارسی) – fa_IR Hindi (हिन्दी) – hi Vietnamese (Tiếng Việt) – vi Thai (ไทย) – th Indonesian (Bahasa Indonesia) – id_ID Urdu (اردو) – ur Want to help translate StaticDelivr CDN into your language? Visit translate.wordpress.org to contribute! License This plugin is licensed under the GPLv2 or later. See License URI for details.