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 428228eb6e2a2f..154bd6a0241216 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 @@ -32,8 +32,22 @@ This override behavior is controlled by [compatibility flags](/workers/configura These flags must be enabled to allow Workers scripts to override cache rules. -If your Worker has a compatibility date of 2025-04-02 or earlier, these flags are not enabled by default. In that case, cache settings defined in the Worker will not override existing cache rules. +### Compatibility date behavior + +Whether these flags are enabled by default depends on your Worker's compatibility date: + +- **Fetch API (`request_cf_overrides_cache_rules`)** + - Enabled by default for compatibility dates **on or after 2025-04-02**. +- **Cache API (`cache_api_request_cf_overrides_cache_rules`)** + - Enabled by default for compatibility dates **on or after 2025-05-19**. + - **Important:** For `cache_api_request_cf_overrides_cache_rules` to be recognized, you must also enable `cache_api_compat_flags`. + - `cache_api_compat_flags` enables the compatibility flag functionality for Workers. If `cache_api_compat_flags` is not set, then no compatibility flags — even if configured — will be recognized by the Cache API. + - `cache_api_compat_flags` is enabled by default for compatibility dates **on or after 2025-04-19**. + +If your Worker has an earlier compatibility date than the ones listed above, the corresponding flags must be manually enabled; otherwise, cache behavior will follow the original cache rules instead of the Worker's settings. ### Example (Older compatibility date) -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. \ No newline at end of file +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