How Exclusion Rules Work in Cache Engine
Overview
Exclusion rules tell Cache Engine what not to touch. They fall into two families, and knowing which one you need is the key to fixing most caching or optimization issues quickly:
Page caching rules answer the question "should this request be served from cache at all?" You manage these on the Preload, Configuration, and Compatibility pages.
Optimization rules answer a different question: "on a page we do cache, which files should be left alone?" You manage these on the Files Optimization and Media pages.
Every rule is stored per site, so anything you add only affects the site you're editing — not other sites on your account.
Important: After changing any rule, purge the cache. Page caching rules (URLs, cookies) stop a page from being served from cache as soon as they take effect, but the old cached copy stays on disk until it's purged or expires naturally. Optimization rules (JS, CSS, media) are applied when a page is built, so pages that are already cached keep their old behavior until they're rebuilt. The dashboard will remind you of this after every save.
Pattern syntax: read this before writing a rule
Different exclusion fields match patterns differently, and mixing them up is the most common source of confusion. Check this table before adding a rule:
Field | Where | How it matches | Wildcard |
|---|---|---|---|
Exclude URLs | Preload page | Matches the URL path only, and must match the whole path (anchored). Case-insensitive; a trailing slash is ignored. | Yes — matches anything, including |
Never cache cookies | Configuration page | Cookie name starts with the text you enter. Case-insensitive. | No |
Allowed query parameters | Configuration page | Exact parameter name, or a prefix if the line ends in | Only as a trailing |
JS / CSS exclusions | Files Optimization page | Matches anywhere inside the file's URL (not anchored). Case-insensitive. | Yes |
JS delay exclusions | Files Optimization page | Same as above, plus the | Yes |
Excluded images and iframes | Media page | Plain text contained in the file URL (also checked against | No — treated as a literal character |
A few rules of thumb that apply everywhere:
One pattern per line; blank lines are ignored.
You can paste a full URL into any field — for Exclude URLs only the path is used, for asset fields the full text is used.
Be specific with URL exclusions.
/aboutwill not match/about-us— that's intentional. Use/about*if you want both.
Page caching exclusions
Exclude URLs (Preload page)
Anything you list under Exclude URLs is treated as uncacheable everywhere: Cache Engine never serves it from cache, the preload crawler skips it in your sitemap, and if the page was already cached it's marked Caching disabled the next time it's processed.
/thank-you → only the thank-you page
/thank-you/* → everything under /thank-you/ (not /thank-you itself)
/author/* → all author archives
*/print → any URL ending in /print or /print/
/landing-* → /landing-a, /landing-b, …Theme, plugin, and WordPress core files are always optimized regardless of your URL exclusions — keep these patterns aimed at page paths, not asset paths.
Never cache cookies (Configuration page)
If a visitor's browser sends a cookie whose name starts with an entry in this list, that request bypasses the cache entirely. This is the tool to reach for with membership, personalization, or A/B-testing plugins that set a cookie for logged-in or segmented visitors.
Every site ships with sensible defaults already in place — for example WooCommerce's cart and currency cookies, or WordPress's own login cookies. You can add to this list freely; just remove an entry only when you're certain that cookie doesn't change what the page shows.
Allowed query parameters (Configuration page)
By default, Cache Engine ignores tracking parameters like utm_source and serves the plain cached page — visitors still see their query string in the address bar, so analytics keeps working. If a parameter genuinely changes the page content (a product filter, for example), turn on Strict query string caching and list it here to create a separate cached copy for that value:
color
paged
orderby
filter_*Parameter order doesn't matter — ?a=1&b=2 and ?b=2&a=1 share one cached copy.
Built-in and auto-detected exclusions
Cache Engine also enforces a set of exclusions you don't need to configure. Sensitive and dynamic paths — /wp-admin/, /cart, /checkout, /my-account, feeds, sitemaps, and similar — are never cached, and this can't be turned off. When a supported plugin like WooCommerce, Easy Digital Downloads, MemberPress, BuddyPress, or LearnDash is detected, Cache Engine automatically adds exclusions for that plugin's dynamic pages, using the actual slugs configured on your site. You can review these on the Compatibility page, but they can't be edited or removed — caching those pages would break the site.
Optimization exclusions
These rules only apply to pages that are already being cached, and each list only has an effect while its related feature is turned on.
CSS Minify Exclusions — keeps a stylesheet's original formatting if minifying it breaks something, while still serving it from the CDN.
CSS Unused Exclusions — keeps a stylesheet fully intact when Remove Unused CSS is on. Useful for styling that only appears after an interaction, like a slider, modal, or mega-menu (common libraries are already safelisted automatically).
JS defer exclusions — keeps a script running in its original position when Defer JS is on. Applies to external scripts only.
JS delay exclusions — keeps a script running immediately when Delay JS is on, instead of waiting for interaction. This is the field to use for scripts or inline snippets (like tag manager code) that need to run right away — matching works on the script's URL, an inline script's
id, or text inside an inline script.CSS delay exclusions — keeps a stylesheet loading immediately when Delay CSS is on.
A number of common scripts (lazy-load libraries, cookie consent banners, render-critical snippets like slider and reCAPTCHA code) are already excluded from delay and defer by default, so most sites won't need to touch this.
Excluded images and iframes (Media page)
One list covers images, videos, and iframes. Anything matching a pattern here is left completely untouched — no compression, no format conversion, no lazy-loading, and no CDN rewrite. Match on a filename, part of a path, a class, an id, alt text, or a domain:
hero-banner.jpg
/wp-content/uploads/2026/logo
no-lazy
player.vimeo.comRemember: this field does not support * as a wildcard — it's matched as plain text.
Recommendation
Start with the built-in and auto-detected exclusions doing the heavy lifting — most sites never need to touch them. Add your own rules only when something specific breaks: a page that shouldn't be public, a script that needs to run immediately, or an image that should bypass the CDN. Keep patterns as specific as possible (avoid short, generic keywords that might match more than you intend), and always purge the cache after saving a change so it takes effect on pages that were already built.
Troubleshooting
My page is served from cache but it shouldn't be. Add its path under Exclude URLs (Preload page) and purge. If the page should only be private for some visitors rather than everyone, use a cookie rule instead so other visitors still get the cached version.
My page is never cached and I don't know why. Check the X-Cache-Engine response header in your browser's developer tools (Network tab). BYPASS means the request was refused because of a session, parameter, cookie, or header; no header at all usually means the URL itself is excluded.
A script or widget broke after enabling Delay JS. Add the script's filename — or a distinctive keyword from it, for inline code — to JS delay exclusions and purge. If it still breaks, the script may depend on a library (like jQuery) that also needs to be excluded.
An image is blurry, lazy-loads too late, or points at the wrong URL. Add its filename or a class name to Excluded images and iframes and purge.
A style is missing on a slider, tab, or popup. Add that stylesheet to CSS Unused Exclusions (if Remove Unused CSS is on) or CSS delay exclusions (if Delay CSS is on), and purge.
If you're still seeing unexpected behavior after trying the steps above, reach out to our support team and we'll help track it down.
