Skip to content

Commit 7266099

Browse files
[Speed] Improves compression docs (#17689)
* Improves compression docs * Apply suggestions from code review Co-authored-by: Pedro Sousa <[email protected]> * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Pedro Sousa <[email protected]> --------- Co-authored-by: Pedro Sousa <[email protected]>
1 parent 9ba83ab commit 7266099

File tree

13 files changed

+34
-68
lines changed

13 files changed

+34
-68
lines changed

public/_redirects

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,10 @@
954954
/support/speed/optimization-delivery/configuring-cloudflare-mirage/ /speed/optimization/images/mirage/ 301
955955
/support/speed/optimization-mobile/understanding-cloudflare-mobile-redirect/ /speed/optimization/other/mobile-redirect/ 301
956956
/support/speed/optimization-file-size/using-cloudflare-auto-minify/ /speed/optimization/content/ 301
957-
/support/speed/optimization-file-size/what-will-cloudflare-compress/ /speed/optimization/content/brotli/ 301
957+
/support/speed/optimization-file-size/what-will-cloudflare-compress/ /speed/optimization/content/compression/ 301
958+
/speed/optimization/content/brotli/ /speed/optimization/content/compression/ 301
959+
/speed/optimization/content/brotli/enable/ /speed/optimization/content/compression/ 301
960+
/speed/optimization/content/brotli/content-compression/ /speed/optimization/content/compression/ 301
958961
/support/speed/optimization-file-size/why-isnt-auto-minify-working/ /speed/optimization/content/troubleshooting/ 301
959962
/support/speed/optimization-mobile/why-is-the-mobile-redirect-i-set-up-through-cloudflare-redirecting-my-static-assets/ /speed/optimization/other/troubleshooting/mobile-redirect-affect-static-assets/ 301
960963
/speed/optimization/other/amp-real-ulr/ /speed/optimization/other/amp-real-url/ 301

src/content/docs/cache/concepts/cache-control.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The `stale-if-error` directive is ignored if [Always Online](/cache/how-to/alway
8686
Additional directives that influence cache behavior are listed below.
8787

8888
* `no-transform` — Indicates that an intermediary — regardless of whether it implements a cache — must not transform the payload.
89-
* `vary` — Cloudflare does not consider vary values in caching decisions. Nevertheless, vary values are respected when [Vary for images](/cache/advanced-configuration/vary-for-images/) is configured and when the vary header is [`vary: accept-encoding`](/speed/optimization/content/brotli/).
89+
* `vary` — Cloudflare does not consider vary values in caching decisions. Nevertheless, vary values are respected when [Vary for images](/cache/advanced-configuration/vary-for-images/) is configured and when the vary header is [`vary: accept-encoding`](/speed/optimization/content/compression/).
9090
* `immutable` — Indicates to clients the response body does not change over time. The resource, if unexpired, is unchanged on the server. The user should not send a conditional revalidation request, such as `If-None-Match` or `If-Modified-Since`, to check for updates, even when the user explicitly refreshes the page. This directive has no effect on public caches like Cloudflare, but does change browser behavior.
9191

9292
## Enable Origin Cache Control

src/content/docs/cache/reference/etag-headers.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Weak ETag headers indicate a cached resource is semantically equivalent to the v
1414
:::note
1515

1616

17-
When using weak ETag headers, it is necessary to disable certain features such as [Email Obfuscation](/waf/tools/scrape-shield/email-address-obfuscation/) and [Automatic HTTPS Rewrites](/ssl/edge-certificates/additional-options/automatic-https-rewrites/) to prevent Cloudflare from removing the ETag headers set by your origin web server. For a comprehensive list of the features you need to disable, refer to the [Notes about end-to-end compression](/speed/optimization/content/brotli/content-compression/#notes-about-end-to-end-compression).
17+
When using weak ETag headers, it is necessary to disable certain features such as [Email Obfuscation](/waf/tools/scrape-shield/email-address-obfuscation/) and [Automatic HTTPS Rewrites](/ssl/edge-certificates/additional-options/automatic-https-rewrites/) to prevent Cloudflare from removing the ETag headers set by your origin web server. For a comprehensive list of the features you need to disable, refer to the [Notes about end-to-end compression](/speed/optimization/content/compression/#notes-about-end-to-end-compression).
1818

1919

2020
:::
@@ -30,7 +30,7 @@ When you enable **Respect Strong ETags** in a cache rule, Cloudflare will use st
3030
However, in some situations Cloudflare will convert strong ETags to weak ETags. For example, given the following conditions:
3131

3232
* **Respect Strong ETags** is enabled
33-
* [Brotli compression](/speed/optimization/content/brotli/) is enabled
33+
* [Brotli compression](/speed/optimization/content/compression/) is enabled
3434
* The origin server's response includes an `etag: "foobar"` strong ETag header
3535

3636
The Cloudflare network will take the following actions, depending on the visitor's `accept-encoding` header and the compression used in the origin server's response:
@@ -60,7 +60,7 @@ When **Respect Strong ETags** is disabled, Cloudflare will preserve strong ETag
6060
In all other situations, Cloudflare will either convert strong ETag headers to weak ETag headers or remove the strong ETag. For example, given the following conditions:
6161

6262
* **Respect Strong ETags** is disabled
63-
* [Brotli compression](/speed/optimization/content/brotli/) is enabled
63+
* [Brotli compression](/speed/optimization/content/compression/) is enabled
6464
* The origin server's response includes an `etag: "foobar"` strong ETag header
6565

6666
The Cloudflare network will take the following actions, depending on the visitor's `accept-encoding` header and the compression used in the origin server's response:

src/content/docs/pages/framework-guides/nextjs/ssr/supported-features.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Cloudflare also supports the older [Pages](https://nextjs.org/docs/pages) router
8585
- N/A: Not applicable
8686
```
8787

88-
[^1]: **compression**: [Cloudflare applies gzip or brotli compression](/speed/optimization/content/brotli/) automatically. When developing locally with Wrangler, no compression is applied.
88+
[^1]: **compression**: [Cloudflare applies Brotli or Gzip compression](/speed/optimization/content/compression/) automatically. When developing locally with Wrangler, no compression is applied.
8989

9090
[^2]: **dev indicators**: If you're developing using `wrangler pages dev`, it hard refreshes your application the dev indicator doesn't appear. If you run your app locally using `next dev`, this option works fine.
9191

src/content/docs/rules/compression-rules/create-dashboard.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ head:
1212
2. Go to **Rules** > **Compression Rules**.
1313
3. To create a new empty rule, select **Create rule**. To duplicate an existing rule, select the three dots next to it > **Duplicate**.
1414
4. Enter a descriptive name for the rule in **Rule name**.
15-
5. Under **When incoming requests match**, select if you wish to apply the rule to [default content types](/speed/optimization/content/brotli/content-compression/#compression-between-cloudflare-and-website-visitors) (content types that Cloudflare compresses by default), or to requests that match a custom filter expression.
15+
5. Under **When incoming requests match**, select if you wish to apply the rule to [default content types](/speed/optimization/content/compression/#compression-between-cloudflare-and-website-visitors) (content types that Cloudflare compresses by default), or to requests that match a custom filter expression.
1616
6. (Optional) To define a custom expression, use the Expression Builder (specifying one or more values for **Field**, **Operator**, and **Value**) or manually enter an expression using the Expression Editor. For more information, refer to [Edit rule expressions](/ruleset-engine/rules-language/expressions/edit-expressions/).
1717
7. Under **Compression options**, set the [compression options](/rules/compression-rules/settings/#dashboard-configuration-settings).
1818
8. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**.

src/content/docs/rules/compression-rules/examples/enable-zstandard.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Example, TabItem, Tabs } from "~/components";
1111

1212
<Tabs syncKey="dashPlusAPI"> <TabItem label="Dashboard">
1313

14-
The following example rule will turn on Zstandard compression for response content types where [Cloudflare applies compression by default](/speed/optimization/content/brotli/content-compression/). If the client does not support Zstandard compression, it will use Brotli or Gzip compression as a fallback.
14+
The following example rule will turn on Zstandard compression for response content types where [Cloudflare applies compression by default](/speed/optimization/content/compression/). If the client does not support Zstandard compression, it will use Brotli or Gzip compression as a fallback.
1515

1616
<Example>
1717

src/content/docs/rules/compression-rules/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { FeatureTable, Render } from "~/components";
99

1010
Use Compression Rules to customize the compression applied to responses from Cloudflare's global network to your website visitors, based on the file extension and content type. Compression Rules are powered by the [Ruleset Engine](/ruleset-engine/).
1111

12-
Cloudflare [compresses some responses by default](/speed/optimization/content/brotli/), based on the content type. With Compression Rules, you can customize the default behavior, which includes defining preferred compression algorithms for particular file types.
12+
Cloudflare [compresses some responses by default](/speed/optimization/content/compression/), based on the content type. With Compression Rules, you can customize the default behavior, which includes defining preferred compression algorithms for particular file types.
1313

1414
When there is a match for a compression rule configured with several compression algorithms, the selected algorithm is the first one supported by the website visitor, according to the received `accept-encoding` HTTP header. If multiple compression rules match, the last rule wins.
1515

src/content/docs/rules/compression-rules/settings.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Enables Cloudflare's default compression setting. Brotli is the preferred compre
2424

2525
### Disable compression
2626

27-
Disables compression for matching requests. Also disables Cloudflare's [default compression behavior](/speed/optimization/content/brotli/content-compression/).
27+
Disables compression for matching requests. Also disables Cloudflare's [default compression behavior](/speed/optimization/content/compression/).
2828

2929
### Custom
3030

@@ -36,12 +36,12 @@ Allowed values are the following:
3636
- **Brotli**: Use the Brotli compression algorithm, if supported by the website visitor.
3737
- **Zstandard**: Use the Zstandard (Zstd) compression algorithm, if supported by the website visitor.
3838
- **Auto**: Compress the response according to the algorithms supported by the website visitor (if any). Cloudflare will define the order of preference for the compression algorithms, which may change in the future. Has the same behavior of the **Enable compression** option.
39-
- **Default**: Use Cloudflare's [default compression behavior](/speed/optimization/content/brotli/), which depends on the response content type.
39+
- **Default**: Use Cloudflare's [default compression behavior](/speed/optimization/content/compression/), which depends on the response content type.
4040

4141
If you specify only _Gzip_, _Brotli_, or _Zstandard_ and no algorithm matches, the response will have no compression. To configure a fallback compression mechanism, add _Auto_ to the list.
4242

4343
:::note
44-
The compression applied by the _Default_ option takes into account global configuration settings such as [Enable Brotli compression](/speed/optimization/content/brotli/).
44+
The compression applied by the _Default_ option takes into account global configuration settings such as [Enable Brotli compression](/speed/optimization/content/compression/).
4545
:::
4646

4747
---
@@ -69,14 +69,14 @@ The supported algorithm values are:
6969
- `zstd`: Use the Zstandard compression algorithm, if supported by the website visitor.
7070
- `none`: Do not use any compression algorithm.
7171
- `auto`: Compress the response according to the algorithms supported by the website visitor (if any). Cloudflare will define the order of preference for the compression algorithms, which may change in the future.
72-
- `default`: Use Cloudflare's [default compression behavior](/speed/optimization/content/brotli/content-compression/#compression-between-cloudflare-and-website-visitors), which depends on the response content type.
72+
- `default`: Use Cloudflare's [default compression behavior](/speed/optimization/content/compression/#compression-between-cloudflare-and-website-visitors), which depends on the response content type.
7373

7474
If you include `none`, `default`, or `auto` in the list, it must be the last value in the list.
7575

7676
When you specify only the `gzip`, `brotli`, or `zstd` algorithms, if no algorithm matches then the response will have no compression. To configure a fallback compression mechanism, add `auto` to the list.
7777

7878
:::note
79-
The compression applied by the `default` algorithm takes into account global configuration settings such as [Enable Brotli compression](/speed/optimization/content/brotli/).
79+
The compression applied by the `default` algorithm takes into account global configuration settings such as [Enable Brotli compression](/speed/optimization/content/compression/).
8080
:::
8181

8282
For API examples, refer to the [Examples gallery](/rules/compression-rules/examples/).

src/content/docs/speed/optimization/content/brotli/enable.mdx

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/content/docs/speed/optimization/content/brotli/index.mdx

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)