Skip to content

Commit 41917d0

Browse files
committed
Move section and update text
1 parent 30f45fd commit 41917d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/content/docs/speed/optimization/content/compression.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ Smaller responses will not be compressed, regardless of their content type.
112112

113113
:::
114114

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+
115119
---
116120

117121
## Content compression from origin servers to the Cloudflare network
@@ -151,10 +155,6 @@ If you do not want a particular response from your origin to be encoded with Bro
151155
Cloudflare will take into consideration the `accept-encoding` header value in website visitors' requests when sending responses to those visitors. However, when requesting content from your origin server, Cloudflare will send a different `Accept-Encoding` header, supporting Brotli and Gzip compression.
152156
:::
153157

154-
### Content-Length header handling
155-
156-
When Cloudflare compresses a response, it may omit the `Content-Length` HTTP header to avoid delivering incorrect length information caused by dynamic transformations. To preserve the `Content-Length` header, 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 by client requests.
157-
158158
---
159159

160160
<Render file="brotli-compression-warning" />

0 commit comments

Comments
 (0)