PluginProbe
SQLite Object Cache / 1.1.0
SQLite Object Cache v1.1.0
1.6.5 trunk 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 All 30 releases
sqlite-object-cache / readme.txt

readme.txt in SQLite Object Cache 1.1.0, at readme.txt

157 lines 10.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 === SQLite Object Cache ===
2 Author: Oliver Jones
3 Contributors: OllieJones
4 Tags: cache, sqlite, performance
5 Requires at least: 5.5
6 Requires PHP: 5.6
7 Tested up to: 6.1.1
8 Version: 1.1.0
9 Stable tag: 1.1.0
10 License: GPLv2 or later
11 License URI: http://www.gnu.org/licenses/gpl-2.0.html
12 Github Plugin URI: https://github.com/OllieJones/sqlite-object-cache
13 Primary Branch: trunk
14 Text Domain: sqlite-object-cache
15 Domain Path: /languages/
16
17 A persistent object cache backend for the rest of us, powered by SQLite.
18
19 == Description ==
20
21 A [persistent object cache](https://developer.wordpress.org/reference/classes/wp_object_cache/#persistent-cache-plugins) helps your site perform well. This one uses the widely available [SQLite3](https://www.php.net/manual/en/book.sqlite3.php) extension to php. Many hosting services offer it. If your hosting service does not provide memcached or redis, you may be able to use this plugin instead and get the benefit of object caching.
22
23 [Caches](https://en.wikipedia.org/wiki/Cache_(computing)) 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](https://en.wikipedia.org/wiki/Cache_(computing)#Memoization) cache.
24
25 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 gets everything it needs from your database server. Only then can it deliver content to your user. With a persistent object cache, WordPress has immediate access to much of the information it needs. This lightens the load on your database server and delivers content to your users faster.
26
27 Thanks to [Till Krüss](https://profiles.wordpress.org/tillkruess/). His [Redis Object Cache](https://wordpress.org/plugins/redis-cache/) plugin serves as a model for this one. And thanks to [Ari Stathopoulos](https://profiles.wordpress.org/aristath/) for reviewing this. (All defects are, of course, entirely the author's responsibility.)
28
29 == Installation ==
30
31 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:
32
33 1. Download the plugin via WordPress.org
34 1. Upload the ZIP file through the 'Plugins > Add New > Upload' screen in your WordPress dashboard
35 1. Activate the plugin through the 'Plugins' menu in WordPress
36
37 == Frequently Asked Questions ===
38
39 = Does this work with a multisite WordPress installation? =
40
41 **Yes**. To see the Settings page, choose Settings > Object Cache from the first site, or any site, in the multisite installation.
42
43 = How much faster will this make my site? =
44
45 Exactly predicting each site's speedup is not possible. Still, benchmarking results are promising. Please see [this](https://www.plumislandmedia.net/wordpress-plugins/sqlite-object-cache/benchmarks/). If you run a benchmark, please let the author know by leaving a comment on that page or using the [support forum](https://wordpress.org/support/plugin/sqlite-object-cache/).
46
47 = What is SQLite? =
48
49 [SQLite](https://www.sqlite.org/about.html) is fast and efficient database software. It doesn't require a separate server. Instead, it is built into php using the [SQLite3](https://www.php.net/manual/en/book.sqlite3.php) extension. SQLite programs don't need to open network connections to send requests and wait for replies.
50
51 = Does this plugin replace MariaDB or MySQL with SQLite? =
52
53 **No.** Your MariaDB or MySQL database sql server still holds all your content. All your site's imports, exports, backups and other database operations continue to function normally. This plugin uses SQLite simply to hold named values. For example, a value named "post|3" will hold a temporary, easy-to-retrieve cached copy of post number 3. When it needs that post, WordPress can fetch it quickly from SQLite.
54
55 = Wait, what? Do I really need two different kinds of SQL database? =
56
57 No, you don't. This plugin doesn't use SQLite as a full-fledged database server.
58
59 A persistent object cache needs some kind of storage mechanism. SQLite serves this plugin as a fast and simple key / value storage mechanism.
60
61 Some hosting providers offer scalable high-performance [redis](https://redis.io/) cache servers. If your provider offers redis, it is a good choice. You can use it via [Redis Object Cache](https://wordpress.org/plugins/redis-cache/) plugin. Sites using redis have one SQL database and another non-SQL storage scheme: redis. Other hosting providers offer [memcached](https://memcached.org/), which has the [Memcached Object Cache](https://wordpress.org/plugins/memcached/).
62
63 But many hosting providers don't offer either redis or memcached, while they do offer SQLite. This plugin enables your site to use a persistent object cache even without a separate cache server.
64
65 = Is this plugin compatible with my version of MySQL or MariaDB? =
66
67 **Yes**. It does not require any specific database server version.
68
69 = Is this plugin compatible with my version of redis or memcached? =
70
71 Please **do not use** this plugin if you have access to redis or memcached. Instead, use the [Redis Object Cache](https://wordpress.org/plugins/redis-cache/) or [Memcached Object Cache](https://wordpress.org/plugins/memcached/) plugin.
72
73 = Why not use the site's main MariaDB or MySql database server for the object cache? =
74
75 In WordPress, as in many web frameworks, your database server is a performance bottleneck. Using some other mechanism for the object cache avoids adding to your database workload. Web servers serve pages using multiple php processes, and each process handles its own SQLite workload while updating a shared database file. That spreads the object-cache workload out over many processes rather than centralizing it.
76
77 = Do I have to back up the data in SQLite? =
78
79 **No.** It's a cache, and everything in it is ephemeral. When WordPress cannot find what it needs in the cache, it simply recomputes it or refetches it from the database.
80
81 = If I already have another persistent object cache, can I use this one? =
82
83 **No.** You only need one persistent object cache, and WordPress only supports one.
84
85 = If I operate a scaled-up load-balanced installation, can I use this? =
86
87 **No.** If you have more than one web server this doesn't work correctly. If you operate at that scale, use redis or some other cache server. (If you aren't sure whether you have a load-balanced installation, you almost certainly do not.)
88
89 = Can I use this with the Performance Lab plugin? =
90
91 **Yes, but** you must *activate this plugin first* before you activate [Performance Lab](https://wordpress.org/plugins/performance-lab/). And, you must deactivate Performance Lab before *deactivating this plugin last*.
92
93 The [Performance Lab plugin](https://wordpress.org/plugins/performance-lab/) offers some advanced and experimental ways of making your site faster. One of its features uses object-cache initialization code to start tracking performance. So there's a required order of activation if you want both to work.
94
95 = How can I use this object cache to make my plugin or theme code run faster? =
96
97 Use transients to store your cacheable data. WordPress's [Transient API](https://developer.wordpress.org/apis/transients/) uses persistent object caching if it's available, and the MariaDB or MySQL database when it isn't. The [Metadata API](https://developer.wordpress.org/apis/metadata/) and [Options API](https://developer.wordpress.org/apis/options/) also use persistent object caching.
98
99 = How does this work? =
100
101 This plugin uses a [WordPress drop-in](https://developer.wordpress.org/reference/functions/get_dropins/) to extend the functionality of the WP_Cache class. When you activate the plugin it creates the dropin file `.../wp-content/object-cache.php`. Upon deactivation, it removes that file and the cached data.
102
103 = Where does the plugin store the cached data? =
104
105 It's in your site's `wp_content` directory, in the file named `.ht.object-cache.sqlite`. That file's name has the `.ht.` prefix to prevent your web server from allowing it to be downloaded. SQLite also sometimes uses the files named `.ht.object-cache.sqlite-shm` and `.ht.object-cache.sqlite-wal`, so you may see any of those files.
106
107 On Linux and other UNIX-derived operating systems, you must give the command `ls -a` to see files when their names begin with a dot.
108
109 = I want to store my cached data in a more secure place. How do I do that?
110
111 If you define the constant `WP_SQLITE_OBJECT_CACHE_DB_FILE` in `wp_config.php` the plugin uses that for the file name instead. For example, if `wp_config.php` contains this line
112
113 `define( 'WP_SQLITE_OBJECT_CACHE_DB_FILE', '/var/tmp/mysite-object-cache.sqlite' );`
114
115 your object cache data goes into the `/var/tmp` folder in a file named `mysite-object-cache.sqlite`.
116
117 = Is there a joke somewhere in this? =
118
119 Q: What are the two hardest things to get right in computer science?
120
121 1. Caching things.
122 2. Naming things.
123 3. Coping with off-by-one errors.
124
125 Seriously, the core of WordPress has already worked out, over years of development and millions of sites, how to cache things and name them. This plugin simply extends that mechanism to make those things persistent.
126
127 = I have another question =
128
129 Please look for more questions and answers [here](https://www.plumislandmedia.net/wordpress-plugins/sqlite-object-cache/faq/). Or ask your question in the [support forum](https://wordpress.org/support/plugin/sqlite-object-cache/).
130
131 == Screenshots ==
132
133 1. Settings panel. Access it with Settings > Object Cache.
134 2. Performance statistics panel.
135
136
137 == Changelog ==
138
139 = 1.1.0 =
140
141 * Test with WordPress 5.5, the earliest version that does not require the obsolete mysql extension.
142 * Change performance logging from time-based to random sampling to reduce overhead.
143 * Fix a race condition upserting cached values under load in pre-3.24 SQLite.
144 * Show availability of the space-saving igbinary serialization on dashboard panels.
145
146 = 1.0.0 =
147
148 1. Use `.ht.object-cache.sqlite` for cached data to prevent downloading it via the web server.
149 2. Add support for the `WP_SQLITE_OBJECT_CACHE_DB_FILE` constant.
150 3. It's possible for the sqlite cache file to become corrupt if a server process crashes. When detecting that kind of situation, the plugin now deletes and rebuilds it.
151
152 = 0.1.7 = First release
153
154 == Upgrade Notice ==
155
156 This release fixes a race condition that shows up under heavy load with SQLite versions before 3.24. It also uses random sampling instead of time-based sampling to capture performance data.
157