Skip to content

Commit 7fac6b7

Browse files
committed
Adds information about normalization
1 parent 2bb460f commit 7fac6b7

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/content/docs/cache/how-to/cache-keys.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ Custom cache keys let you precisely set the cacheability setting for any resourc
3434
7. You can also select settings for **Headers**, **Cookie**, **Host**, and **User**.
3535
8. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**.
3636

37+
:::note
38+
When [URL normalization](/rules/normalization/) is enabled, we recommend also enabling [Normalize URLs to origin](/rules/normalization/manage/), especially if you are setting custom cache keys or using cache by device type, which also modifies the cache key. This helps ensure the URL in the cache key matches the URL sent to the origin, preventing cache poisoning and ensuring consistent behavior.
39+
:::
40+
3741
## Cache Key Template
3842

3943
There are a couple of common reasons to change the Cache Key Template. You might change the Cache Key Template to:

src/content/docs/cache/how-to/cache-rules/settings.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ Enterprise customers have these additional options for custom cache keys:
188188
- In the **Cookie** section, you can include cookie names and their values, and check for the presence of another cookie.
189189
- In the **Host** section, you can select **Use original host** and **Resolved host**. In the **User** section, you can select **Device type**, **Country**, and **Language**. Using **Resolved host** means the cache key will contain whatever hostname was used to resolve the origin IP which can be different depending on whether the [resolve override](/rules/origin-rules/features/#dns-record) feature is on or not.
190190

191+
:::note
192+
When [URL normalization](/rules/normalization/) is enabled, we recommend also enabling [Normalize URLs to origin](/rules/normalization/manage/), especially if you are setting custom cache keys or using cache by device type, which also modifies the cache key. This helps ensure the URL in the cache key matches the URL sent to the origin, preventing cache poisoning and ensuring consistent behavior.
193+
:::
194+
191195
<Details header="API information">
192196

193197
API configuration object name: `"cache_key"`.

0 commit comments

Comments
 (0)