Set up and clear the page cache
The page cache stores the finished HTML output of a page as a file and, on the next call, delivers it from that file instead of rebuilding the page from the theme and the database. WordPress itself is still loaded — the cache takes effect inside WordPress. It is intended for anonymous visitors: logged-in users continue to get freshly generated pages. Out of the box the cache is switched off.
Switching on and setting the lifetime
- Open “Kakapo Performance” in the WordPress menu and, in the left sidebar under “Speed”, choose the item “Page cache” (in German: „Seiten-Cache“).
- Switch on “Page cache active”.
- Under “Lifetime (hours)”, enter how long a stored page is used before it is regenerated on the next call. 1 to 168 hours are allowed, the default is 8.
- Under “Exclusion URLs”, add the paths that should never be cached: one per line, “*” is allowed as a wildcard.
- The “Cache contents” card then shows how many pages are stored and how much storage space they take up.
What never ends up in the cache
- Views by logged-in users and everything in the WordPress admin area
- Everything other than GET requests, plus every call with a query string
- AJAX, cron, REST and XMLRPC requests
- 404 pages
- Views with cookies for password protection, login, comment author or shopping cart (WooCommerce, Easy Digital Downloads)
- Addresses that are on the exclusion list
Where the files are stored
The pages are stored as HTML files in the upload directory. There the plugin additionally creates an .htaccess with “Deny from all”, so that the files cannot be called directly. An output is only stored if it is at least 255 characters long and contains a closing </html>.
wp-content/uploads/kwpp-cacheWhen the cache is cleared
- When you click “Clear cache” in the overview or in the “Page cache” (in German: „Seiten-Cache“) panel; this also resets the hits and misses in the statistics
- Automatically when a post is saved, deleted or moved to the trash
- Automatically on a theme change, after saving in the Customizer, on a new comment and when a menu is changed
- When “Page cache active” is switched off and when the plugin is deactivated
Checking the hit rate
Under “Analysis”, the item “Reports” shows the hit rate as well as the number of cache hits and cache misses. If no request has been counted yet, zeros are shown there, and the card “Cache efficiency” shows a note instead of the bars. As soon as requests have been counted, the same card also names the current number of files and their size.