You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/rules/reference/troubleshooting.mdx
+13-10Lines changed: 13 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,9 @@ head:
7
7
- tag: title
8
8
content: Rules troubleshooting
9
9
description: Review common troubleshooting scenarios for Rules features.
10
-
11
10
---
12
11
13
-
import { Example, Render } from"~/components"
12
+
import { Example, Render } from"~/components";
14
13
15
14
## Interaction between Cloudflare challenges and Rules features
16
15
@@ -28,6 +27,10 @@ For example, define a compound expression for your rule using the `and` operator
28
27
29
28
If you are using [HTTP DCV](/ssl/edge-certificates/changing-dcv-method/methods/http/) and also have [Single Redirects](/rules/url-forwarding/single-redirects/) set up in your zone, consider excluding the `/.well-known/*` path from your rule to avoid DCV issues. For details and other resources refer to the [SSL/TLS documentation](/ssl/edge-certificates/changing-dcv-method/).
30
29
30
+
## Content-Length header removed from response
31
+
32
+
Cloudflare may remove the `Content-Length` header from responses delivered to website visitors. If the visitor must receive the `Content-Length` header, configure the origin server to include a `cache-control: no-transform` HTTP header in the response.
33
+
31
34
## URL rewrites affect other Rules features executed later
32
35
33
36
If you rewrite a URI path using a [URL rewrite](/rules/transform/url-rewrite/), this may affect other Rules features executed later — such as [Origin Rules](/rules/origin-rules/) — if they include the URI path in their filter expression.
@@ -36,17 +39,17 @@ Consider the following origin rule configuration:
36
39
37
40
<Example>
38
41
39
-
* Rule expression: `http.host == "example.com" and starts_with(http.request.uri.path, "/downloads/")`
Copy file name to clipboardExpand all lines: src/content/docs/speed/optimization/content/compression.mdx
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,6 +112,10 @@ Smaller responses will not be compressed, regardless of their content type.
112
112
113
113
:::
114
114
115
+
### Content-Length header handling
116
+
117
+
When Cloudflare compresses a response sent to the website visitor, it may omit the `Content-Length` HTTP header to avoid delivering incorrect length information caused by dynamic transformations. To preserve the `Content-Length` header set by the origin server, add `cache-control: no-transform` to the origin server's response. This directive prevents Cloudflare from altering compression on responses, allowing the `Content-Length` header to pass through as-is. The `cache-control: no-transform` header must be set by the origin — it cannot be added in client requests.
118
+
115
119
---
116
120
117
121
## Content compression from origin servers to the Cloudflare network
@@ -155,7 +159,7 @@ Cloudflare will take into consideration the `accept-encoding` header value in we
155
159
156
160
<Renderfile="brotli-compression-warning" />
157
161
158
-
## Compression methods by plan
162
+
## Compression methods by plan
159
163
160
164
### Between visitors and Cloudflare
161
165
@@ -167,4 +171,4 @@ By default, Cloudflare uses the following compression methods for content delive
167
171
168
172
### Between Cloudflare and the origin server
169
173
170
-
On all plans, Cloudflare requests content from the origin server using the `accept-encoding: br, gzip` header. This means that Cloudflare asks the origin to send the content compressed using Brotli or Gzip, depending on which method the origin server supports.
174
+
On all plans, Cloudflare requests content from the origin server using the `accept-encoding: br, gzip` header. This means that Cloudflare asks the origin to send the content compressed using Brotli or Gzip, depending on which method the origin server supports.
Copy file name to clipboardExpand all lines: src/content/partials/speed/brotli-compression-warning.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@
4
4
5
5
## Notes about end-to-end compression
6
6
7
+
### Content recompression due to dynamic transformations
8
+
7
9
Even when using the same compression algorithm end to end (between your origin server and Cloudflare, and between the Cloudflare global network and your website visitor), Cloudflare will need to decompress the response and compress it again if you enable any of the following settings for the request:
@@ -20,3 +22,7 @@ To disable these settings for specific URI paths, create a [configuration rule](
20
22
:::note
21
23
Additionally, the [Replace insecure JS libraries](/waf/tools/replace-insecure-js-libraries/) setting also requires Cloudflare to decompress the response and compress it again. At this time, you cannot turn it off using Configuration Rules.
22
24
:::
25
+
26
+
### Content-Length header
27
+
28
+
Cloudflare may remove the `Content-Length` HTTP header of responses delivered to website visitors. To ensure that the header is preserved, add a `cache-control: no-transform` HTTP header to the response at the origin server.
0 commit comments