For sites managed from code, put your settings in wp-content/softminal-cache.json. Its values override the stored settings, and the settings screens become read only with the note “Settings are managed by a config file”. Purge and preload still work.
{"lifetime":36000,"exclusions":["/members/*"],"modules":{"js":{"minify":true},"bloat":{"emoji":true}}}
Rules
- The file must be a JSON object inside
wp-content, at most 64 KB. - Unknown keys are ignored.
- Changing the file clears the cache.
- To use another path, define
SOFTMINAL_CACHE_CONFIGinwp-config.php. - The For developers card on the Tools tab shows whether the file is in use or has errors.
Keys
enabled, safe_mode, mobile_cache, stale_while_revalidate, cache_404_feeds, logged_in_cache, browser_cache, compression, status_header, preload_after_purge, preload_speed, lifetime, exclusions, cookies, ignored_params and modules.
| Module | Keys |
|---|---|
js | minify, defer, jquery_migrate, exclusions |
css | minify, exclusions |
fonts | local_google, swap, preload |
images | lazy, first, iframes, dimensions, webp, avif, quality |
bloat | emoji, embeds, dashicons, xmlrpc, head_links, self_pingbacks, query_strings, heartbeat, revisions |
script-manager | rules |
On Nginx, block direct access to the file. See Nginx setup.