Skip to content

Speed

Enabling the cache

Switch on the page cache, add optimisations one at a time, and know how to turn everything off in an emergency.

Before you start

  • Deactivate any other caching plugin first. Two page caches fight each other
  • If your host has its own page cache, leave one of the two off
  • Take a backup

Switch on the page cache

The page cache, every optimisation and every CDN lane start off, because switching them on changes files on your site. Open Speed and turn on the page cache. Swiftkeep then:

  • Installs a cache drop-in in your content folder, which serves stored pages before the rest of WordPress loads
  • Adds define( 'WP_CACHE', true ); to wp-config.php, between marker comments, after backing the file up and checking the result
  • Starts preloading, so pages are cached before visitors ask for them

If wp-config.php cannot be written

Some hosts lock the file. The plugin then shows the exact lines to add by hand, and the cache starts once they are in place.

How purging works

When you publish or update something, the pages that show it are purged and rebuilt. The rest of the cache is left alone. Changes that affect every page, such as a new theme or an edited menu, clear the whole cache. You can also purge everything from the Speed screen.

Cached pages expire after ten hours by default. You can change the lifetime.

Add optimisations one at a time

Each optimisation has its own switch and starts off: minifying HTML, CSS and JavaScript, deferring JavaScript, lazy-loading images and embeds, and serving WebP, among others. There is a recommended preset if you would rather start from sensible choices.

  1. 1

    Turn one on

    Start with the ones least likely to affect layout: lazy-loading and WebP.

  2. 2

    Check the site

    Open your home page, a post and, on a shop, the cart and checkout. Use a private window so you see what visitors see.

  3. 3

    Keep it or undo it

    If something breaks, turn that one switch off. Deferring JavaScript is the most likely to need a script excluded.

Emergency switch

If you cannot reach wp-admin, add this line to wp-config.php. It switches off the page cache and every optimisation:

define( 'SWIFTKEEP_SPEED_DISABLED', true );

Rules already written to .htaccess or to your Cloudflare zone stay in place. The Speed screen tells you when this line is in effect. Remove it to switch the module back on.

Turning the cache off

Turning the cache off removes the drop-in, the WP_CACHE line and the page-cache rules it added to .htaccess. Deactivating the plugin also removes its other server rules. The rules it created in your Cloudflare zone are deleted when you disconnect Cloudflare.

Next

Add the CDN: connect Cloudflare if your DNS is there, or read how the three lanes work.

Written for Swiftkeep 2.1.6. Under white label, the plugin shows your agency's name where this guide says Swiftkeep.