---
schema_version: "1"
id: f53bde40209def84f152e298b7a48f84d1d4868ef83962029155c79a220ae667
title: Create an eCDN Cache Rule
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/cc/264-0-0/b2c_create_ecdn_cache_rule.md
canonical_url: https://help.salesforce.com/s/articleView?id=cc.b2c_create_ecdn_cache_rule.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 21f8188b0b0176bbc4677676f0e3b3d8756fc6f5855fbc453a0e86ad2c3408c4
description: 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.
products:
  - Commerce
  - B2C Commerce
release: "264"
---
# 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.

A cache rule makes an otherwise-uncacheable content type eligible for caching, but it doesn't force caching. For a response to be cached, your origin must still return appropriate `Cache-Control` (or `Expires`) response headers. For details about how eCDN decides what to cache, see [eCDN Cache Rules and Cache Purge](https://help.salesforce.com/s/articleView?id=cc.b2c_ecdn_cache_rules_and_purge_overview.htm&release=264.0.0&type=5 "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.").

Before you create a rule, review these limits.

- A zone supports a maximum of 200 cache rules.
- The expression length limit is 4,096 characters.
- eCDN supports only the `cache` action. To prevent caching, configure your origin to send `private`, `no-store`, `no-cache`, or `max-age=0`.
- eCDN caches GET requests only, regardless of the rule configuration.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/images/icon_note.png)

Note Cache rules aren't available on SCAPI zones, where caching is platform-managed. See [SCAPI Zone Support for B2C Commerce](https://help.salesforce.com/s/articleView?id=cc.b2c_scapi_zone.htm&release=264.0.0&type=5 "A SCAPI zone is the Salesforce-managed eCDN zone that fronts Salesforce Commerce API (SCAPI) traffic. Starting with B2C Commerce 26.10, the Production instance includes a subset of eCDN security controls and analytics for this zone in Business Manager and the CDN API, with no support case required.").

1. In Business Manager, click App Launcher ![App Launcher](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/cc/b2c_merchandiser_administrator/images/appLauncher.png), and then select **Administration** | **Sites** | **Embedded CDN Settings**.
2. Locate the zone that you want to configure, and select **Configure Zone** from the dropdown menu.
    
    ![Embedded CDN Settings zone list with Configure Zone selected from the zone actions menu](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/cc/b2c_merchandiser_administrator/images/b2c_ecdn_configure_zone_select_zone.png)
3. Open the **Cache Rules** section.
    
    ![Cache Rules tab in Configure Zones with no cache rules configured and the New Cache Rule button](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/cc/b2c_merchandiser_administrator/images/b2c_ecdn_configure_zone_cache_rules.png)
4. Click **New Cache Rule**, and then complete the rule fields.
    
    Complete the required fields.
    
    - **Description**: A human-readable label for the rule.
    - **Expression**: The match condition (maximum 4,096 characters). Supports fields such as `http.request.uri.path`, `http.request.uri.path.extension`, `http.host`, `http.cookie`, and `ssl`.
    - **Action**: Only `cache` is supported, which marks matching content as eligible for caching.
    
    Complete the optional fields as needed.
    
    - **Enabled**: Turns the rule on or off without deleting it. Selected by default.
    - **Exclude query strings**: The query parameters to exclude from the cache key (for example, `gclid` and `utm_campaign`).
    - **Ignore query string order**: Sorts query parameters alphabetically so that ordering variations hit the same cache entry. Deselected by default.
    - **Respect strong ETags**: Honors strong `ETag` validators from the origin. Deselected by default.
    - **Position**: Places this rule before or after another rule to control precedence. By default, the rule is added at the end.
    
    ![Edit Cache Rule form showing the rule name, expression builder, expression preview, cache action, and optional cache key settings](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/cc/b2c_merchandiser_administrator/images/b2c_ecdn_configure_zone_cache_rules_edit_rule.png)
5. Order rules as needed.
    
    When multiple rules match a request, the last matching rule takes effect.
6. Save the rule.
    
    The rule applies at the eCDN edge for that zone.
    
    ![Saved cache rule listed on the Cache Rules tab with its priority, action, and enabled status](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/cc/b2c_merchandiser_administrator/images/b2c_ecdn_configure_zone_cache_rules_list.png)

![Example Cache Rule Expressions for B2C Commerce eCDN](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/images/icon_example.png)

Example Cache Rule Expressions for B2C Commerce eCDN

To cache PWA Kit product detail pages (HTML), use this expression.

```
(http.request.uri.path matches ".*/product/[^/]+/?$" and http.request.uri.path.extension eq "html")
```

For this rule, use these options:

- Exclude `gclid` and `utm_campaign`
- Ignore query string order
- Respect strong ETags

To cache SFRA content and marketing pages (HTML), use this expression.

```
((http.request.uri.path contains "/content/" or http.request.uri.path contains "/campaigns/") and http.request.uri.path.extension eq "html")
```

After content is cacheable, you can invalidate it from Business Manager. See [Purge the eCDN Cache](https://help.salesforce.com/s/articleView?id=cc.b2c_purge_ecdn_cache.htm&release=264.0.0&type=5 "Selectively invalidate content in the B2C Commerce eCDN cache by cache tag or path directly from Business Manager.").

#### See Also

- [Traffic Management for Flash Sales](https://developer.salesforce.com/docs/commerce/commerce-solutions/guide/traffic-management-sk.html)