Skip to content

Commit e5bcb43

Browse files
committed
Update content compression page
1 parent 5432d3b commit e5bcb43

File tree

2 files changed

+18
-27
lines changed

2 files changed

+18
-27
lines changed

src/content/docs/fundamentals/reference/http-request-headers.mdx

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
---
22
pcx_content_type: reference
33
title: Cloudflare HTTP request headers
4-
54
---
65

7-
import { Render } from "~/components"
6+
import { Render } from "~/components";
87

98
Cloudflare passes all HTTP request headers to your origin web server and adds additional headers as specified below.
109

1110
:::note
1211

13-
Cloudflare may remove HTTP request headers with names considered invalid [according to NGINX](https://nginx.org/en/docs/http/ngx_http_core_module.html#ignore_invalid_headers) — for example, header names containing a `.` (dot) character.
12+
Cloudflare may remove HTTP request headers with names considered invalid [according to NGINX](https://nginx.org/en/docs/http/ngx_http_core_module.html#ignore_invalid_headers) — for example, header names containing a `.` (dot) character.
1413
:::
1514

1615
## Accept-Encoding
1716

18-
For incoming requests, the value of this header will always be set to `accept-encoding: gzip, br`. If the client set a different value, such as `accept-encoding: deflate`, it will be overwritten and the original value will be available in `request.cf.clientAcceptEncoding`.
17+
For incoming requests, the value of this header will always be set to `accept-encoding: br, gzip`. If the client set a different value, such as `accept-encoding: deflate`, it will be overwritten and the original value will be available in `request.cf.clientAcceptEncoding`.
1918

2019
## CF-Connecting-IP
2120

@@ -40,7 +39,7 @@ When no Worker subrequest is triggered, `cf-connecting-ip` reflects the client's
4039

4140
Cloudflare provides [free IPv6 support](/network/ipv6-compatibility/) to all domains without requiring additional configuration or hardware. To support migrating to IPv6, Cloudflare's [Pseudo IPv4](/network/pseudo-ipv4/) provides an IPv6 to IPv4 translation service for all Cloudflare domains.
4241

43-
<Render file="pseudo-ipv4-warning" /> <br/>
42+
<Render file="pseudo-ipv4-warning" /> <br />
4443

4544
## CF-EW-Via
4645

@@ -62,10 +61,8 @@ Alternatively, if you do not wish to receive the `True-Client-IP` header or any
6261

6362
:::caution
6463

65-
6664
If you are using Cloudflare in a stacked CDN and authenticating HTTP requests based on the IP address value in the `True-Client-IP` header, you must add a `True-Client-IP` header to your requests. If you do not add this header, its value can be spoofed to any value.
6765

68-
6966
:::
7067

7168
## X-Forwarded-For
@@ -80,10 +77,8 @@ If you do not wish to receive the visitor's IP address in the `X-Forwarded-For`
8077

8178
:::note
8279

83-
8480
To restore the original visitor IP address at your origin web server, Cloudflare recommends that your logs or applications look at `CF-Connecting-IP` or `True-Client-IP` instead of `X-Forwarded-For`. `CF-Connecting-IP` and `True-Client-IP` both have a consistent format containing only one IP address.
8581

86-
8782
:::
8883

8984
## X-Forwarded-Proto
@@ -104,19 +99,17 @@ Enterprise customers can also see all requests via [Cloudflare Logs](/logs/).
10499

105100
The `CF-IPCountry` header contains a two-character country code of the originating visitor’s country.
106101

107-
Besides the [ISO-3166-1 alpha-2 codes](https://www.iso.org/iso-3166-country-codes.html), Cloudflare uses the following special country codes:
102+
Besides the [ISO-3166-1 alpha-2 codes](https://www.iso.org/iso-3166-country-codes.html), Cloudflare uses the following special country codes:
108103

109-
* `XX` - Used for clients without country code data.
110-
* `T1` - Used for clients using the Tor network.
104+
- `XX` - Used for clients without country code data.
105+
- `T1` - Used for clients using the Tor network.
111106

112107
To add this header to requests, along with other HTTP headers with location information for the visitor's IP address, [enable the **Add visitor location headers** Managed Transform](/rules/transform/managed-transforms/configure/).
113108

114109
:::note
115110

116-
117111
The `CF-IPCountry` header is removed from requests made from a Worker to an origin that is not proxied behind Cloudflare.
118112

119-
120113
:::
121114

122115
## CF-Visitor
@@ -141,10 +134,8 @@ The intended purpose of this header is to provide a means for recipients (for ex
141134

142135
:::note
143136

144-
145137
When configuring WAF custom rules, do not match on this header. These rules are applied before Cloudflare adds the `CF-Worker` header. Instead, use the [`cf.worker.upstream_zone`](/ruleset-engine/rules-language/fields/dynamic-fields/#cfworkerupstream_zone) dynamic field, which contains the same value and exists for the same purpose.
146138

147-
148139
:::
149140

150141
## Connection
@@ -155,5 +146,5 @@ For incoming requests, the value of this header will always be set to `Keep-Aliv
155146

156147
When using Spectrum with a TCP application, these headers are not visible at the origin as they are HTTP headers. If you wish to utilize these in your application, there are two options:
157148

158-
* Use an HTTP or HTTPS Spectrum app instead of TCP
159-
* Use the [Proxy Protocol feature](/spectrum/how-to/enable-proxy-protocol/)
149+
- Use an HTTP or HTTPS Spectrum app instead of TCP
150+
- Use the [Proxy Protocol feature](/spectrum/how-to/enable-proxy-protocol/)

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,19 @@ Smaller responses will not be compressed, regardless of their content type.
116116

117117
## Content compression from origin servers to the Cloudflare network
118118

119-
When requesting content from your origin server, Cloudflare supports Gzip compression, Brotli compression, or no compression.
119+
When requesting content from your origin server, Cloudflare supports Brotli compression, Gzip compression, or no compression.
120120

121121
```mermaid
122122
flowchart LR
123123
accTitle: Compressed responses sent from the origin server
124-
accDescr: Cloudflare accepts responses from origin server using Gzip compression, Brotli compression, or no compression.
124+
accDescr: Cloudflare accepts responses from origin server using Brotli compression, Gzip compression, or no compression.
125125
126126
A[Visitor browser]
127127
B((Cloudflare))
128128
C[(Origin server)]
129129
130-
A -.-> B == "Request<br>Accept-Encoding: gzip, br" ==> C
131-
C == "Response<br>(Gzip / Brotli / No compression)" ==> B -.-> A
130+
A -.-> B == "Request<br>Accept-Encoding: br, gzip" ==> C
131+
C == "Response<br>(Brotli / Gzip / No compression)" ==> B -.-> A
132132
133133
style A stroke-dasharray: 5 5
134134
style B stroke: orange,fill: orange,color: black
@@ -137,18 +137,18 @@ linkStyle 1,2 stroke-width: 2px
137137
linkStyle 0,3 stroke-width: 1px
138138
```
139139

140-
If your origin server responds to a Cloudflare request using Gzip/Brotli compression, we will keep the same compression in the response sent to the website visitor if:
140+
If your origin server responds to a Cloudflare request using Brotli/Gzip compression, we will keep the same compression in the response sent to the website visitor if:
141141

142-
- You include a `content-encoding` header in your server response mentioning the compression being used (`gzip` or `br`).
142+
- You include a `content-encoding` header in your server response mentioning the compression being used (`br` or `gzip`).
143143
- The visitor browser (or client) supports the compression algorithm.
144144
- You do not enable Cloudflare features that change the response content (refer to [Notes about end-to-end compression](#notes-about-end-to-end-compression) for details).
145145

146-
Cloudflare's reverse proxy can also convert between compressed formats and uncompressed formats. Cloudflare can receive content from your origin server with Gzip or Brotli compression and serve it to visitors uncompressed (or vice versa), independently of caching.
146+
Cloudflare's reverse proxy can also convert between compressed formats and uncompressed formats. Cloudflare can receive content from your origin server with Brotli or Gzip compression and serve it to visitors uncompressed (or vice versa), independently of caching.
147147

148-
If you do not want a particular response from your origin to be encoded with Gzip/Brotli when delivered to website visitors, you can disable this by including a `cache-control: no-transform` HTTP header in the response from your origin web server.
148+
If you do not want a particular response from your origin to be encoded with Brotli/Gzip when delivered to website visitors, you can disable this by including a `cache-control: no-transform` HTTP header in the response from your origin web server.
149149

150150
:::caution
151-
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 Gzip and Brotli compression.
151+
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.
152152
:::
153153

154154
---

0 commit comments

Comments
 (0)