Settings reference#
All settings live in one option, bb_cache_settings, edited under Settings → BB Cache. The keys and defaults
below come from BB_Cache_Settings::defaults(); the descriptions follow the field help in inc/class-admin.php.
How values are stored#
- Checkboxes are stored as
1or0. Numbers are cast to integers;cache_lifespan,lazyload_skipandcf_edge_ttlcannot be negative. - Lists are entered one item per line. Lines are trimmed, empty lines dropped and duplicates removed.
- Choice fields fall back to their default when given an unknown value.
- Every save posts all settings (the other tabs travel as hidden fields), rewrites
config.php, writes or removes the.htaccessblock and purges the page cache and the minified files. - Where a list accepts "substring or regex", an entry is first tried as a plain substring. It is also tried as a
case-insensitive regular expression when it contains one of
\ ( ) [ ] | * + ? ^ $.reject_uriandreject_uaare matched by the drop-in with their own rules, noted in their rows.
Some defaults were written for the site the plugin was built for. They are marked Site-specific default, review for your site.
Page cache#
| Key | Default | What it does |
|---|---|---|
page_cache |
1 |
Stores the HTML of public pages under wp-content/cache/bb-cache/pages and serves it before WordPress loads. |
cache_lifespan |
10 |
Hours a cached file is valid. 0 keeps files until something purges them. |
cache_mobile |
1 |
Keeps a second file per URL for phone user agents. |
purge_all_on_update |
0 |
On: any post update purges everything. Off: purge the post, the home page, its archives and its parent only. |
preload_after_purge |
0 |
After a full purge, warm the cache from the sitemap in the background. |
cache_query_strings |
empty | Parameter names, one per line, that may be cached as separate variants. Pages with other parameters bypass the cache; marketing parameters (utm_*, gclid, fbclid and others) are ignored. |
reject_uri |
see below | URIs that are never cached. Each entry is matched as a substring and as a regex. |
reject_cookies |
see below | Cookie name prefixes. A request carrying a matching cookie is never served from or stored in the cache. |
reject_ua |
empty | User agents that are never cached. Each entry is a case-insensitive regex. |
htaccess_rules |
0 |
Writes an Apache rewrite block to .htaccess that serves cached files without starting PHP. Removed on deactivation. See Hosting notes. |
varnish_host |
empty | Host that receives PURGE requests mirroring each page-cache purge, for example 127.0.0.1. Blank disables. See Hosting notes. |
Default reject_uri:
/wp-json/
/feed/
/xmlrpc.php
/wp-login.php
/cart/
/checkout/
/my-account/
Default reject_cookies:
wordpress_logged_in_
wp-postpass_
comment_author
woocommerce_cart_hash
woocommerce_items_in_cart
wp_woocommerce_session_
Cloudflare#
Details in Cloudflare.
| Key | Default | What it does |
|---|---|---|
cf_purge |
0 |
Mirrors every page-cache purge to the Cloudflare zone at the end of the request. Needs the zone ID and an API token. |
cf_zone |
empty | Zone ID, 32 hexadecimal characters. Overridden by the BB_CACHE_CF_ZONE constant. |
cf_token |
empty | API token with the permission Zone > Cache Purge > Purge. Overridden by the BB_CACHE_CF_TOKEN constant, which is the preferred place for it. |
cf_purge_mode |
urls |
urls (Changed URLs): purge exactly the URLs the page cache purged. all (Everything): purge the whole zone on any purge. |
cf_edge_ttl |
0 |
Seconds the edge may hold public HTML, sent as s-maxage. 0 sends no edge headers. |
File optimization#
| Key | Default | What it does |
|---|---|---|
minify_css |
1 |
Removes comments and whitespace from local stylesheets; relative url() paths are made root-relative. |
concat_css |
1 |
Combines consecutive same-origin stylesheets into one file per page composition. |
exclude_css |
empty | Stylesheets to leave alone. Substring or regex of the URL. |
combine_google_fonts |
1 |
Merges multiple fonts.googleapis.com links into one with display=swap. |
minify_js |
1 |
Strips comments from local scripts. Newlines are kept; .min.js files are left as they are. |
concat_js |
0 |
Combines consecutive same-origin scripts with identical defer state into one file. |
exclude_js |
see below | Scripts to leave alone. Substring or regex of the URL or tag. Site-specific default, review for your site. |
optimize_logged_in |
0 |
Also run the optimisers for logged-in users. Off so editors see the raw page. |
Default exclude_js (third-party script URLs used by the originating site; minify and combine only touch local
files, so these entries have no effect on most sites and can be cleared):
fast.wistia.com/assets/external/E-v1.js
consent.cookiebot.com/uc.js
track.getgobot.com/gobot/js/pixel.js
assets.adoberesources.net/loader.js
static.claydar.com/init.v1.js
JavaScript#
| Key | Default | What it does |
|---|---|---|
defer_js |
0 |
Adds defer to script tags with a src. |
exclude_defer_js |
see below | Scripts that are not deferred. jQuery is excluded because inline scripts use $ immediately. |
delay_js |
0 |
Delays scripts until the first keypress, pointer movement, touch, click or wheel event, or the timeout below. |
delay_js_mode |
thirdparty |
thirdparty: only scripts from other hosts and inline scripts that call them. all: every script except the exclusions. |
delay_js_timeout |
5 |
Seconds after which delayed scripts run without interaction. 0 means only on interaction. |
delay_js_exclusions |
see below | Scripts that are never delayed. Partly site-specific default, review for your site. |
Default exclude_defer_js:
/jquery-?[0-9.]*(.min|.slim|.slim.min)?.js
code.jquery.com
Default delay_js_exclusions:
/jquery-?[0-9.](.*)(.min|.slim|.slim.min)?.js
code.jquery.com
js-(before|after)
(?:/wp-content/|/wp-includes/)(.*)
/forms2.min.js
mktoweb.com/js/forms2/js/forms2.min.js
consent.cookiebot.com
Cookiebot
speculationrules
application/ld+json
The jQuery, js-(before|after), /wp-content/ and /wp-includes/, speculationrules and application/ld+json
entries are generic. The Marketo forms (forms2.min.js) and Cookiebot entries reflect the vendors the originating
site used; keep them only if you use the same vendors, and add your own consent and form scripts.
Media#
| Key | Default | What it does |
|---|---|---|
lazyload_images |
0 |
Adds loading="lazy" and decoding="async" to images. Images with fetchpriority or an existing loading attribute are untouched. |
lazyload_skip |
2 |
Leave the first N images eager. Images in the first screen stay eager regardless. |
lazyload_iframes |
0 |
Adds loading="lazy" to iframes. |
lazyload_youtube |
0 |
Replaces YouTube embeds with a click-to-play preview; the player loads on click. |
exclude_lazyload |
see below | Images and iframes that are never lazy-loaded. Substring or regex of the tag (class, file name). Site-specific default, review for your site. |
image_dimensions |
0 |
Adds missing width and height attributes to local images. Off by default because a theme that sizes images with width:auto and object-fit can show warped images once the attributes are present. |
Default exclude_lazyload (class names and file names from the originating theme; they match nothing elsewhere and
can be cleared):
caorusel-slide-img
promo-header__img
manage-pipelines-at-scale.png
single-logo
testimonial-slider--logo
g2-feb.png
gartner-feb.png
Boost#
| Key | Default | What it does |
|---|---|---|
critical_css |
0 |
Inlines the page's critical CSS and loads every stylesheet asynchronously with a <noscript> fallback. Pages without critical CSS keep blocking stylesheets. See Critical CSS. |
critical_dir |
empty | Folder holding the critical CSS files. Blank means <active theme>/assets/dist/css/critical. |
critical_inline |
see below | Stylesheets inlined whole instead of loaded asynchronously, by substring or regex of the href, up to 24 KB each. Site-specific default, review for your site. |
host_google_fonts |
0 |
Fetches the Google Fonts CSS and font files once into cache/bb-cache/fonts and inlines the CSS with font-display:swap. |
cache_webp |
0 |
Swaps image URLs for a .webp sibling where one exists, for browsers that accept image/webp. Keeps a separate cache variant. |
lcp_preload |
0 |
Gives the first large, non-lazy image (or a hero background or video poster) fetchpriority="high" and a preload hint. |
exclude_lcp |
empty | Images never treated as the LCP image. Substring or regex of the tag or URL. |
lazy_videos |
0 |
Attaches <video> sources only when the video is near the viewport; the poster shows meanwhile. |
responsive_images |
0 |
Adds srcset and sizes to upload images the theme prints without them. |
auto_preconnect |
0 |
Adds preconnect hints for up to six third-party script and stylesheet hosts found on the page. |
html_minify |
0 |
Removes indentation, blank lines and comments. Whitespace between inline elements is not changed. |
content_visibility |
0 |
Adds content-visibility: auto to matching sections after the first N. Test with scroll-driven animations, which measure positions. |
content_visibility_selectors |
content-section |
Class names, one per line, matched on section, div, article and footer elements. Site-specific default, review for your site. |
content_visibility_skip |
2 |
Leave the first N matching sections untouched. |
Default critical_inline:
/css/pages/
/custom-css-js
/css/pages/ is the originating theme's folder of page-scoped stylesheets; /custom-css-js matches the files
written by a custom CSS and JS plugin. Replace both with the paths of your own page-scoped sheets, or clear the list.
Preload#
| Key | Default | What it does |
|---|---|---|
preload_links |
1 |
Prefetches same-origin pages when the pointer rests on a link (or on touch start). Disabled for visitors with data saver or a 2G connection. |
preload_cache |
0 |
Warms the page cache daily from the sitemap. Also available on demand from the admin bar, the Tools tab and WP-CLI. |
sitemap_url |
empty | Sitemap to read. Blank tries /sitemap_index.xml, /sitemap.xml and /wp-sitemap.xml and uses the first that answers 200. |
dns_prefetch |
empty | Hosts to add as dns-prefetch hints, one per line. |
preconnect |
empty | Hosts to add as preconnect hints, one per line. |
preload_fonts |
empty | Font URLs to preload, one per line. |
Heartbeat#
The three Heartbeat settings accept default (do not touch), reduce (every 2 minutes) or disable.
| Key | Default | What it does |
|---|---|---|
heartbeat_admin |
reduce |
Heartbeat on dashboard and admin pages. |
heartbeat_editor |
reduce |
Heartbeat in the post editor (post.php, post-new.php, site-editor.php). Disabling it turns off autosave and post locking. |
heartbeat_front |
reduce |
Heartbeat on the front end. |
disable_emoji |
1 |
Removes the WordPress emoji detection script and styles. |
Tools tab#
The Tools tab holds no settings. It offers: purge all pages, clear minified CSS and JS (which also purges the pages),
preload from the sitemap with its progress, reinstall the drop-in and set WP_CACHE, write or remove the .htaccess
rules (with the block shown for manual pasting), the list of critical CSS files found, and the debug flags.