You are here:
eCDN Cache Rules and Cache Purge
Cache rules control which content is eligible for caching at the eCDN edge, and cache purge selectively invalidates cached content by tag or path. Both capabilities are available in Business Manager for your B2C Commerce storefront.
Use cache rules to control which content is eligible for caching at the eCDN edge. By default, eCDN caches only static content based on file extension and doesn't cache HTML pages or JSON responses. Cache rules make HTML pages and JSON responses eligible for edge caching, which is a prerequisite for using cache purge by specific tags or paths.
Use cache purge to selectively invalidate cached content by cache tag or path directly from Business Manager, using the Purge Cache button.
Both capabilities were previously available only through the CDN API. They're self-service in Business Manager.
Cache-Control (or
Expires) response headers for eligible content to be cached.Where Cache Rules and Cache Purge Are Available
To configure cache rules and purge the cache, in Business Manager, go to , and then select Configure Zone for the zone that you want. Cache rules and the Purge Cache button are available at zone scope for these zone types.
| Zone Type | Instance Group | Cache Rules | Cache Purge |
|---|---|---|---|
| Storefront zones | PIG (production, staging, and development) | Available | Available |
| Default zones | PIG | Available | Available |
| ODS Default zones | SIG (On-Demand Sandboxes) | Available | Available |
| SCAPI zones | — | Not Available | Available (tag and path) |
How SCAPI Zones Differ
For SCAPI zones, only cache purge is available, and cache rules aren't exposed. This behavior is intentional.
- SCAPI caching is a platform-managed capability. To prevent changes to SCAPI caching behavior, cache-rule self-service is disabled for these zones.
- SCAPI workers set cache tags automatically when they cache a response. You don't define tags for SCAPI zones yourself.
- The ecom-side (JWA) invalidation flow synchronizes SCAPI cache invalidation.
- You can purge SCAPI zone content by tag or by path.
How eCDN Decides What to Cache
Understanding the caching decision helps you write effective rules.
By default, when no cache rules are configured, eCDN caches by file extension only. Common
static extensions (images, JS, CSS, fonts, video, documents, and archives) are cached. eCDN
doesn't cache HTML, JSON, XML, or TXT responses by default (except robots.txt).
The maximum cacheable object size is 5 GB.
A response is cached only when all of these conditions are true.
- The request method is GET.
- The response has no
Set-Cookieheader. - The response has
Cache-Control: publicwithmax-age > 0, or a futureExpiresdate. When multiple values are present, the precedence iss-maxage, thenmax-age, thenExpires.
A response isn't cached if any of these conditions are true.
Cache-Controlisprivate,no-store,no-cache, ormax-age=0.- No
Cache-Controlheader is present. - A
Set-Cookieheader is present. - The request method isn't GET.
Best Practices
- Cache HTML and JSON deliberately. Make dynamic content eligible only where the response
is genuinely shared across shoppers and safe to cache. Never cache personalized or
authenticated responses. Make sure that those responses carry
Set-CookieorCache-Control: private. - Use cache tags for coordinated invalidation. Stamp related content with shared tags (for example, by product, category, or content asset) so that you can purge a logical group in one request instead of listing paths.
- Exclude tracking parameters from the cache key (for example,
gclidandutm_campaign) to maximize the cache hit ratio. - Verify caching with the
Cf-Cache-Statusresponse header. A value ofHITconfirms edge caching. A value ofMISSorDYNAMICindicates that the content wasn't served from cache. - Test in a sandbox first. ODS Default zones support cache rules and purge, so you can validate rule behavior on a sandbox before you apply it to production.
Troubleshooting
Content isn't caching as expected? Check, in order:
- Origin headers — is the response sending
Cache-Control: public, max-age>0(or a futureExpires)? Set-Cookie— aSet-Cookieheader suppresses caching. Remove it for cacheable responses.- Request method — only
GETis cached. - Expression accuracy — does the rule expression actually match the request path/extension?
- Rule enabled? — confirm the rule's Enabled flag is on.
Cf-Cache-Statusheader —HITvsMISS/DYNAMICtells you whether the edge served from cache.
- Create an eCDN Cache Rule
Create a cache rule to make HTML pages and JSON responses eligible for caching at the eCDN edge for your B2C Commerce storefront. By default, eCDN caches only static content based on file extension. - Purge the eCDN Cache
Selectively invalidate cached content by cache tag or path directly from Business Manager. Click Purge Cache for your B2C Commerce storefront.
