Filters and actions

Skip caching a page

Return a short reason to keep a page out of the cache. It shows as BYPASS: reason in the header.

add_filter( 'softminal_cache_bypass', function ( $reason ) {
	if ( is_page( 'live-scores' ) ) {
		return 'live-scores';
	}
	return $reason;
} );

Filters

FilterUse
softminal_cache_bypassReturn a reason string to skip caching the current page.
softminal_cache_host_cacheReturn the name of a host cache, so Softminal Cache keeps its page cache off.
softminal_cache_harmless_cookiesCookies a page may set and still be cached (default: language cookies).
softminal_cache_rewriteReturn false to turn off HTML optimisation for a request.
softminal_cache_server_softwareOverride the detected server: apache, nginx or other.
softminal_cache_htaccess_filePath of the .htaccess file to write to.

Actions

ActionWhen
softminal_cache_purged_allAfter the whole cache is cleared.
softminal_cache_purged_urlAfter one address is cleared. Gets the URL.
softminal_cache_register_passesAdd your own HTML optimisation pass. Gets the rewriter.
softminal_cache_pass_failedAn HTML pass failed and was rolled back. Gets the pass id and the error.

Any plugin can also define DONOTCACHEPAGE to keep a page out of the cache.

Still stuck? Please write to us at support.softminal.com. Our team will help you.