Skip to content

Commit 572347a

Browse files
authored
[Rules] Clarify rule execution for Transform Rules (#26783)
1 parent f3d8cdb commit 572347a

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

src/content/docs/rules/transform/request-header-modification/index.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ You can create a request header transform rule [in the dashboard](/rules/transfo
6666

6767
- To use [claims inside a JSON Web Token (JWT)](/api-shield/security/jwt-validation/transform-rules/), you must first set up a token validation configuration in API Shield.
6868

69+
- Request header transform rules run in order, and later rules can overwrite changes done by previous rules.
70+
71+
- The values of request and response fields are immutable within each [phase](/ruleset-engine/about/phases/), such as the `http_request_late_transform` phase where request header transform rules are defined. This means that later request header transform rules will not match based on changes done by previous request header transform rules. Refer to [Field values during rule evaluation](/ruleset-engine/about/rules/#field-values-during-rule-evaluation) for more information.
72+
73+
## Execution order
74+
75+
<Render file="product-execution-order" product="rules" />
76+
6977
<Render
7078
file="troubleshoot-rules-with-trace"
7179
product="rules"

src/content/docs/rules/transform/response-header-modification/index.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,16 @@ You can create a response header transform rule [in the dashboard](/rules/transf
6565

6666
- Currently, there is a limited number of HTTP response headers that you cannot change. Cloudflare may remove restrictions for some of these HTTP response headers when presented with valid use cases. [Create a post in the community](https://community.cloudflare.com) for consideration.
6767

68-
- Response Header Transform Rules will also apply to default Cloudflare error pages and [Custom Errors](/rules/custom-errors/).
68+
- Response header transform rules will also apply to default Cloudflare error pages and [Custom Errors](/rules/custom-errors/).
6969

7070
- Modifying `cache-control`, `CDN-Cache-Control`, or `Cloudflare-CDN-Cache-Control` headers will not change the way Cloudflare caches an object. Instead, you should create a [Cache Rule](/cache/how-to/cache-rules/).
7171

7272
- To add a `set-cookie` header to the response, make sure you use one of the _Add static_/_Add dynamic_ operations instead of _Set static_/_Set dynamic_. Using one of the _Set_ operations will remove any `set-cookie` headers already in the response, including those added by other Cloudflare products such as Bot Management.
7373

74+
- Response header transform rules run in order, and later rules can overwrite changes done by previous rules.
75+
76+
- The values of request and response fields are immutable within each [phase](/ruleset-engine/about/phases/), such as the `http_response_headers_transform` phase where response header transform rules are defined. This means that later response header transform rules will not match based on changes done by previous response header transform rules. Refer to [Field values during rule evaluation](/ruleset-engine/about/rules/#field-values-during-rule-evaluation) for more information.
77+
7478
<Render
7579
file="troubleshoot-rules-with-trace"
7680
product="rules"

src/content/docs/rules/transform/url-rewrite/index.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,9 @@ When using Cloudflare Images, you can use URL Rewrite Rules to serve images from
4747
product="rules"
4848
params={{ rulesFeatureName: "URL Rewrite Rules" }}
4949
/>
50+
51+
## Important remarks
52+
53+
- URL rewrite rules run in order, and later rules can overwrite changes done by previous rules.
54+
55+
- The values of request and response fields are immutable within each [phase](/ruleset-engine/about/phases/), such as the `http_request_transform` phase where URL rewrite rules are defined. This means that later URL rewrite rules will not match based on changes done by previous URL rewrite rules. Refer to [Field values during rule evaluation](/ruleset-engine/about/rules/#field-values-during-rule-evaluation) for more information.

0 commit comments

Comments
 (0)