Our plugin, Servebolt Optimizer, enables you to:

Enable our best practise database optimisations for WordPress and WooCommerce
Read the errorlog directly from the WordPress Admin
Enable the Full Page Cache

How to use it with WP CLI

Install the plugin
wp plugin install servebolt-optimizer --activate [--network]

You should now be able to run wp servebolt and get this response
usage: wp servebolt db <command>
or: wp servebolt fpc <command>

See 'wp help servebolt <command>' for more information on a specific command.


Control the Full Page Cache
All Full Page Cache commands are subcommands of wp servebolt fpc

Activate/Deactivate the Full Page Cache
wp servebolt fpc activate|deactivate [--post_types] [--url] [--all]

activate
Activates the main Full Page Cache switch

deactivate
Deactivates the main Full Page Cache switch

Optional parameters
--post_types
Send a comma seperated list of the post types you want to activate/deactivate Full Page Cache for.
wp servebolt fpc activate|deactivate --post_types=post,product

--url
Control the cache of one or multiple sites in a multisite. Works just like the --url global parameter in WP-CLI core.

--all
Activate/Deactivate Full Page Cache for all sites in a multisite

Display status of the Full Page Cache
wp servebolt fpc status [--url] [--all]

Optional parameters
--url
See cache status of one or multiple sites in a multisite. Works just like the --url global parameter in WP-CLI core.

--all
See Full Page Cache status for all sites in a multisite

Control cache time
We built in a hidden feature in the plugin, where you can control the cache time for both the server-side Full Page Cache, and the browser cache.

Default cache time for both Full Page Cache and browser cache is 600 seconds (10 minutes), which is the Servebolt best practise. The recommended cache time ensures that dynamic content will refresh within 10 minutes and help with scale when you need it, and is generally safe for all website configurations.

Control the server-side full page cache time

Be aware, the full page cache cannot be purged, so adjust these settings with care. Consult with Servebolt Support if you are in doubt.
define('SERVEBOLT_FPC_CACHE_TIME', 600); // Default is 600 seconds (10 minutes)

Control the browser cache time

define('SERVEBOLT_BROWSER_CACHE_TIME', 600); // Default is 600 seconds (10 minutes)
Was this article helpful?
Thank you!