Hyper Cache is a lite, simple to configure and highly performant cache plugin for WordPress.
Hyper Cache is a cache system for WordPress. I wrote it because my hosting provider was very low in resources, particularly on the MySql side. Hyper Cache solved all my performance problems. It probably can solve yours as well!
The aim of Hyper Cache is to be efficient but easy to configure. It has a simple configuration panel with preset values ready for your blog. You can tweak the configuration to improve even more the performances or to address specific needs.
It is bbPress ready: Hyper cache is able to detect new topics and replies and refresh the forum cached pages.
Download and Support
How to detect if it is working
Use a clean browser (not the one you use to administer your blog or open a new browser window in anonymous mode), and load the same page a couple of times. Look at the page source and at bottom you should see the Hyper Cache signature.
Another way is to use a browser developer tool and look at the network panel: the response header for a cached page should contains the specific “X-Hyper-Cache” header with value “hit” or “hit-mobile”.
Hyper Cache main features
- easy installation: just activate Hyper Cache and it works with a set of default values
- easy configuration: you can just ignore the configuration panel (even if enabling the compression is a good idea!)
- mobile cache: separated cache for mobile devices (when you use mobile oriented themes or plugins)
- theme switch for mobile devices
- compression support to optimize your bandwidth usage and the overall page load speed (important with mobile devices)
- configurable bypass (when the cache should not… cache): by page address, user agent, cookies, feeds and so on
- 404 caching
- bbPress ready: can cache and refresh bbPress pages
- special refresh options
- configurable caching only of the newest posts
Download and Installation
Download it from the WordPress Plugin Repository or search for “Hyper Cache” in your blog plugin panel. Once activate, go to the configuration panel and follow the instructions.
Usually you need wo add a lince of code in the wp-config.php file just after the define(‘WPLANG’, ‘xx_YY’):
If that definition is already present in your wp-config.php file, modify it as shown above.
The plugin options are explained inside the configuration panel, here you can find some deeper concept or annotations.
Cached pages will be valid for…
It’s a time in hours used to consider still valid an already cached page. If a page is in cache but older than the specified number of hour, it is not considered and regenerated.
Usually you should leave this option empty to use it’s default value (auto computed by Hyper Cache). The cache folder where cached pages are store is locate at wp-content/cache/hyper-cache. You can specify an absolute path lo move it but pay attention: is you wrongly point the cache folder to an existing folder with files, on cache refresh they can be deleted.
Compression should be enabled for two reason:
- save a bit of bandwidth (mostly of the bandwidth is used for images and not for the text part of a page…)
- serve the content as quickly as possible to make the user experience better
More, if you have a mainly textual blog, you’ll save traffic on the client side, which is very good for mobile user with expensive data plans.
When the browser caching is enabled, Hyper Cache tells browsers to keep a copy of the page in their cache and to not request the page again (until it expires).
The expiration time can be set in hours in the option panel or it will be computed as the time remaining for the page in your blog cache. For example, if the page has been cached 1 hour ago and your cache timeout is set to 24 hours, the browser will receive the suggestion to keep the page for 23 hours.
Pay attention: I usually keep this option off because if you change something of important in your blog, regular users will see always the already visited pages and cached in their browser. Only a forced reload will refresh the local user cache but not all web users know about it.
Hyper Cache can be configured to totally ignore some type of pages. For example you may want to not cache the home page to have it always fresh or the feeds to save disk space since they are rarely requested. Remember that WordPress has a feed for each post…
Other bypass are based on matching rules: for example if you have a forum installed which pages live under the URL “/forums” (actually it’s more correct to call the URIs), to never cache such pages add “/forums” to the “starting with URIs to bypass”.
Other bypasses are per user agent, cookie name or exact URI.
The URI is the part of a site page address without the domain name. For example this page address is
the URI is “/plugins/hyper-cache” with a starting “/”. So if I want to NOT cache this page I need to specify “/plugins/hyper-cache” as URI to bypass.
If there are more than a URI to exclude just insert one per line. Remember: the URI is the full piece after the domain name. If your blog is installed under a path like:
to exclude that page you must use as URI the value “/blog/plugins/hyper-cache”.
For the “starting with” URI matching the same considerations apply.
The special case of comment authors
When a user leaves a comment in your blog, WordPress uses some cookies to store his data and fill the comment for fields with his name, email and site, The cache must take care of that, to avoid serving a page with those fields filled with another user data.
So, most of the caches simple disable them self when a visitor has those comment cookies. Hyper Cache is able to manage that situation and serve cached pages to comment authors visiting the blog, still pre-filling the comment fields with the visitor’s data.
If your blog is serving different content and or a different theme to mobile devices, you must consider to have a double cache, one for the desktop content/theme and one for the mobile content/theme.
Mobile detection must be enabled and the user agents set compatibly to the ones used by other plugin/themes. Hyper Cache must be able to decide to serve the desktop or mobile version on its own, otherwise the cache benefit will be lost.
Hyper Cache can be configure to activate a different theme when it detect a mobile device: it’s a simple integrated theme switcher.
A use case. I use Header and Footer to inject different ads formats for mobile devices, even if the theme does not change (it’s responsive). I have Header and Footer detecting the mobile devices in the same fashion than Hyper Cache so pages are cache with different ads code for desktop and mobile visitors.
Unluckily there is no a standard in WordPress so a detection system can be used initially and make all the plugin use it…
My cart widget does not work anymore. Do not use the cache or look at a widget configuration which let it to be loaded via AJAX.
My statistic plugin is no more working. Hyper Cache, when possible, serves directly a page without activate WordPress (and hence the installed plugins).
The cache folder is missing. Create it manually wp-content/cache/hyper-cache. For security reason some blogs have a write lock on wp-content folder.
I found no file in the cache folder. Try to set it to 777 permission level: for some reasons and on some providers Hyper Cache cannot write in that directory.
Why have I to use Hyper Cache and not other cache systems? I really cannot answer that question: Hyper Cache is free as for other cache plugin… take the one which gives more performances to your blog!
Where are the cache pages? In to the folder /wp-content/cache/hyper-cache: if you empty that directory the cache starts from zero. Do not delete the directory!
It’s to pre-fill the comment fields even on cached pages. To disable it disable the serving of cached pages to comment authors.