ezCache is a replacement for the standard WordPress database (WPDB) class which adds the ability to use multiple caches to reduce the amount of queries sent to the database server.
The original WPDB class within WordPress is a modified version of a previous release of the ezSQL class - ezCache utilises the latest version of the ezSQL class combining the functionality of WPDB with ezSQL caching as well as providing additional caches.
Cache types
- Options cache
Any options accessed from the database that are not preloaded by WordPress are cached in an array for the duration of the dynamic page creation process.
If any options are requested again during this time, then the SQL query results come from the array and not the Database server. - Pre-load cache
Once a dynamic page is created by WordPress, this cache will save all of its SQL query results into the cache as a single file.
The next time that page is accessed, the cache of results for that page are loaded into an array for subsequent use. - SQL cache
This is the caching method that comes with ezSQL, it caches every query as a separate file into the cache.
If the same query is used on different pages throughout the WordPress website, then this cache will store the SQL query results.
Functionality
Please Note: ezCache may or may not noticeably improve the performance of WordPress but WILL dramatically reduce the amount of SQL queries sent to the database server.
Unlike some other caches for WordPress, ezCache is easy to install and defaults to using the standard WPDB class without caching.
To activate, you just define a few options within wp_config.php - this makes ezCache very easy to disable if database caching is not for you.
Each cache can be switched on or off and you can even use the ezSQL class on its own as a direct replacement for WPDB as required.
Features
- No caching of WordPress options, admin pages or previews
- No caching of any SQL that makes use of RAND
- Cache timeout for the pre-load and SQL caches can be set individually
- Cache statistics (more on this later)
- Clear a single pages pre-load and SQL cache as well as deleting the entire cache without accessing the admin pages.
See also
- On this website within the Projects category, the post ‘WordPress Database Cache‘ explains the initial concept behind ezCache
- Looking elsewhere, the WPDB class can also be replaced by HyperDB which adds the ability to use multiple databases


One Response to “ezCache”
ezCache | Honeymonster's Lair
[...] The project pages for this are available in the ezCache section on Deadpan110’s site. [...]
Using:
Leave a Response...