From 2f0e1e55063e409435a112ea6a63111407ca9cd4 Mon Sep 17 00:00:00 2001 From: nenizera Date: Mon, 1 Dec 2025 14:49:05 +0000 Subject: [PATCH] Update workers-cache-rules.mdx Hello team, Cache Rules per products name. For clarity, could we link here our docs on Workers, Cache and Page Rules, as well as Fetch and Cache API? Thanks. --- .../workers-cache-rules.mdx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/content/docs/cache/interaction-cloudflare-products/workers-cache-rules.mdx b/src/content/docs/cache/interaction-cloudflare-products/workers-cache-rules.mdx index 154bd6a0241216b..e68e5705cdf78e1 100644 --- a/src/content/docs/cache/interaction-cloudflare-products/workers-cache-rules.mdx +++ b/src/content/docs/cache/interaction-cloudflare-products/workers-cache-rules.mdx @@ -9,7 +9,7 @@ head: --- -Your Workers script can override [cache rule](/cache/how-to/cache-rules/) behavior, whether it is applied to a zone using Cloudflare or a zone that is not proxied through Cloudflare. +Your Workers script can override [Cache Rules](/cache/how-to/cache-rules/) behavior, whether it is applied to a zone using Cloudflare or a zone that is not proxied through Cloudflare. For example, if there is a cache rule configured to bypass cache for `example.com/foo`, but your Workers script sets `cacheEverything: true`, the script's setting will take precedence, and the request will be cached. The same applies if the request is made to a non-Cloudflare zone — the Worker's `cacheEverything` setting will still override. @@ -17,9 +17,9 @@ For example, if there is a cache rule configured to bypass cache for `example.co Cache behavior is determined by the following order of precedence: -1. Workers script settings -2. Cache rules -3. Page rules +1. [Workers](/workers/) script settings +2. [Cache rules](/cache/how-to/cache-rules/) +3. [Page rules](/rules/page-rules/) Cache rules override page rule settings, and Workers scripts override cache rules. Among rules at the same level, the one with the highest specificity takes priority. @@ -27,8 +27,8 @@ Cache rules override page rule settings, and Workers scripts override cache rule This override behavior is controlled by [compatibility flags](/workers/configuration/compatibility-flags/): -- For the Fetch API: `request_cf_overrides_cache_rules` -- For the Cache API: `cache_api_request_cf_overrides_cache_rules` +- For the [Fetch API](/workers/runtime-apis/fetch/): `request_cf_overrides_cache_rules` +- For the [Cache API](/workers/runtime-apis/cache/): `cache_api_request_cf_overrides_cache_rules` These flags must be enabled to allow Workers scripts to override cache rules. @@ -50,4 +50,4 @@ If your Worker has an earlier compatibility date than the ones listed above, the If a cache rule is configured to bypass cache for `example.com/foo`, and a Worker with a compatibility date of `2025-04-02` or earlier tries to set `cacheEverything: true`, the cache rule will take effect, and the response will not be cached. -Likewise, if using the Cache API without `cache_api_compat_flags` enabled, even if you enable `cache_api_request_cf_overrides_cache_rules`, the Cache API will not take effect. \ No newline at end of file +Likewise, if using the Cache API without `cache_api_compat_flags` enabled, even if you enable `cache_api_request_cf_overrides_cache_rules`, the Cache API will not take effect.