How to use Servebolt Optimizer for WordPress

Our plugin, Servebolt Optimizer, enables you to:

WordPress backend

Servebolt Optimizer is configurable either through WordPress Admin or through WP-CLI, which is covered beneath.

Performance Optimizer

Allows you to optimize your database and set the right table indexes. Optimizing will add any missing indexes and convert all tables to use modern storage engines.

Accelerated Domains

Allows you to enable Accelerated Domains. Cache purging for Accelerated Domains is covered in the “Cache Purging” section.

Cache settings

This is where you can enable HTML caching (Full-Page Cache) through our plugin. You can also set WordPress posts to exclude caching from. Keep in mind that if you enable HTML caching through our plugin, you will also need to enable “Static Files + Full-Page Cache” in the settings of your site in our Control Panel.

Cache Purging

Our cache purging section allows you to purge cache for either Cloudflare or Accelerated Domains if that is setup.

Review the error log

Allows you to check the ErrorLog of your site through our plugin.

General settings

General settings is where you can enable automatic version parameter to asset URLs, enable Cloudflare APO support or Use native JS fallback.

How to use Servebolt Optimizer with WP-CLI

Install the plugin

Manage WP-CLI using the following commands:

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

Update Servebolt Optimizer to a later version

wp plugin update servebolt-optimizer

You are now be able to run wp servebolt and get this response

usage: wp servebolt acd <command>
   or: wp servebolt cache <command>
   or: wp servebolt cf <command>
   or: wp servebolt cf-image-resize <command>
   or: wp servebolt db <command>
   or: wp servebolt delete-all-settings [--all] [--format=<format>]
   or: wp servebolt fpc <command>
   or: wp servebolt general-settings <command>

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

Control Accelerated Domains

Main commands for Accelerated Domains where you can activate, deactivate or check the status of Accelerated Domains:

wp servebolt acd activate // Activates the feature in Servebolt Optimizer
wp servebolt acd deactivate // Deactivates the feature in Servebolt Optimizer
wp servebolt acd status // Checking the status of Accelerated Domains in Servebolt Optimizer

You can flush the Accelerated Domains cache from the command line. Either the cache for a specific URL or the whole site. Keep in mind that flushing the entire site is not recommended, as it will make the load on the site higher. Always try to flush that what’s needed:

wp servebolt cache purge all // Purges the whole site
wp servebolt cache purge url <URL> // Purges the specific URL in the <URL> parameter

A parameter can be useful if you have a multisite and you are just running Accelerated Domains on one of your domains in your network. Here’s an example of where you would purge the whole site from a specific domain in your network:

wp servebolt cache purge all --url=https://acd-sub.domain.com

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 separated 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

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. In a default setup, you can change the cache timer in your wp-config.php file. 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)

Give us your feedback on this article