diff --git a/public/_redirects b/public/_redirects index 903e3e3c58c2547..144c01be01b5cbd 100644 --- a/public/_redirects +++ b/public/_redirects @@ -954,7 +954,10 @@ /support/speed/optimization-delivery/configuring-cloudflare-mirage/ /speed/optimization/images/mirage/ 301 /support/speed/optimization-mobile/understanding-cloudflare-mobile-redirect/ /speed/optimization/other/mobile-redirect/ 301 /support/speed/optimization-file-size/using-cloudflare-auto-minify/ /speed/optimization/content/ 301 -/support/speed/optimization-file-size/what-will-cloudflare-compress/ /speed/optimization/content/brotli/ 301 +/support/speed/optimization-file-size/what-will-cloudflare-compress/ /speed/optimization/content/compression/ 301 +/speed/optimization/content/brotli/ /speed/optimization/content/compression/ 301 +/speed/optimization/content/brotli/enable/ /speed/optimization/content/compression/ 301 +/speed/optimization/content/brotli/content-compression/ /speed/optimization/content/compression/ 301 /support/speed/optimization-file-size/why-isnt-auto-minify-working/ /speed/optimization/content/troubleshooting/ 301 /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 /speed/optimization/other/amp-real-ulr/ /speed/optimization/other/amp-real-url/ 301 diff --git a/src/content/docs/cache/concepts/cache-control.mdx b/src/content/docs/cache/concepts/cache-control.mdx index 45c2cb1b2dffccd..6cf19ea91bc8b4a 100644 --- a/src/content/docs/cache/concepts/cache-control.mdx +++ b/src/content/docs/cache/concepts/cache-control.mdx @@ -86,7 +86,7 @@ The `stale-if-error` directive is ignored if [Always Online](/cache/how-to/alway Additional directives that influence cache behavior are listed below. * `no-transform` — Indicates that an intermediary — regardless of whether it implements a cache — must not transform the payload. -* `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/). +* `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/). * `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. ## Enable Origin Cache Control diff --git a/src/content/docs/cache/reference/etag-headers.mdx b/src/content/docs/cache/reference/etag-headers.mdx index 024cd19c9ee5f09..794b5ccf89761bb 100644 --- a/src/content/docs/cache/reference/etag-headers.mdx +++ b/src/content/docs/cache/reference/etag-headers.mdx @@ -14,7 +14,7 @@ Weak ETag headers indicate a cached resource is semantically equivalent to the v :::note -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). +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). ::: @@ -30,7 +30,7 @@ When you enable **Respect Strong ETags** in a cache rule, Cloudflare will use st However, in some situations Cloudflare will convert strong ETags to weak ETags. For example, given the following conditions: * **Respect Strong ETags** is enabled -* [Brotli compression](/speed/optimization/content/brotli/) is enabled +* [Brotli compression](/speed/optimization/content/compression/) is enabled * The origin server's response includes an `etag: "foobar"` strong ETag header 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 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: * **Respect Strong ETags** is disabled -* [Brotli compression](/speed/optimization/content/brotli/) is enabled +* [Brotli compression](/speed/optimization/content/compression/) is enabled * The origin server's response includes an `etag: "foobar"` strong ETag header 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: diff --git a/src/content/docs/pages/framework-guides/nextjs/ssr/supported-features.mdx b/src/content/docs/pages/framework-guides/nextjs/ssr/supported-features.mdx index 4b938def174bc38..8efd76c4b29c3fe 100644 --- a/src/content/docs/pages/framework-guides/nextjs/ssr/supported-features.mdx +++ b/src/content/docs/pages/framework-guides/nextjs/ssr/supported-features.mdx @@ -85,7 +85,7 @@ Cloudflare also supports the older [Pages](https://nextjs.org/docs/pages) router - N/A: Not applicable ``` -[^1]: **compression**: [Cloudflare applies gzip or brotli compression](/speed/optimization/content/brotli/) automatically. When developing locally with Wrangler, no compression is applied. +[^1]: **compression**: [Cloudflare applies Brotli or Gzip compression](/speed/optimization/content/compression/) automatically. When developing locally with Wrangler, no compression is applied. [^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. diff --git a/src/content/docs/rules/compression-rules/create-dashboard.mdx b/src/content/docs/rules/compression-rules/create-dashboard.mdx index cf41cbc52f4846b..c6bc68737361b4e 100644 --- a/src/content/docs/rules/compression-rules/create-dashboard.mdx +++ b/src/content/docs/rules/compression-rules/create-dashboard.mdx @@ -12,7 +12,7 @@ head: 2. Go to **Rules** > **Compression Rules**. 3. To create a new empty rule, select **Create rule**. To duplicate an existing rule, select the three dots next to it > **Duplicate**. 4. Enter a descriptive name for the rule in **Rule name**. -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. +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. 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/). 7. Under **Compression options**, set the [compression options](/rules/compression-rules/settings/#dashboard-configuration-settings). 8. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**. diff --git a/src/content/docs/rules/compression-rules/examples/enable-zstandard.mdx b/src/content/docs/rules/compression-rules/examples/enable-zstandard.mdx index afde19bacbdd1b5..4b500557dae2122 100644 --- a/src/content/docs/rules/compression-rules/examples/enable-zstandard.mdx +++ b/src/content/docs/rules/compression-rules/examples/enable-zstandard.mdx @@ -11,7 +11,7 @@ import { Example, TabItem, Tabs } from "~/components"; -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. +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. diff --git a/src/content/docs/rules/compression-rules/index.mdx b/src/content/docs/rules/compression-rules/index.mdx index bd6794b918079e0..8dd59ca5a92647a 100644 --- a/src/content/docs/rules/compression-rules/index.mdx +++ b/src/content/docs/rules/compression-rules/index.mdx @@ -9,7 +9,7 @@ import { FeatureTable, Render } from "~/components"; 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/). -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. +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. 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. diff --git a/src/content/docs/rules/compression-rules/settings.mdx b/src/content/docs/rules/compression-rules/settings.mdx index 67217ab5bade1a3..0ea721d3a9c9ec9 100644 --- a/src/content/docs/rules/compression-rules/settings.mdx +++ b/src/content/docs/rules/compression-rules/settings.mdx @@ -24,7 +24,7 @@ Enables Cloudflare's default compression setting. Brotli is the preferred compre ### Disable compression -Disables compression for matching requests. Also disables Cloudflare's [default compression behavior](/speed/optimization/content/brotli/content-compression/). +Disables compression for matching requests. Also disables Cloudflare's [default compression behavior](/speed/optimization/content/compression/). ### Custom @@ -36,12 +36,12 @@ Allowed values are the following: - **Brotli**: Use the Brotli compression algorithm, if supported by the website visitor. - **Zstandard**: Use the Zstandard (Zstd) compression algorithm, if supported by the website visitor. - **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. -- **Default**: Use Cloudflare's [default compression behavior](/speed/optimization/content/brotli/), which depends on the response content type. +- **Default**: Use Cloudflare's [default compression behavior](/speed/optimization/content/compression/), which depends on the response content type. 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. :::note -The compression applied by the _Default_ option takes into account global configuration settings such as [Enable Brotli compression](/speed/optimization/content/brotli/). +The compression applied by the _Default_ option takes into account global configuration settings such as [Enable Brotli compression](/speed/optimization/content/compression/). ::: --- @@ -69,14 +69,14 @@ The supported algorithm values are: - `zstd`: Use the Zstandard compression algorithm, if supported by the website visitor. - `none`: Do not use any compression algorithm. - `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. -- `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. +- `default`: Use Cloudflare's [default compression behavior](/speed/optimization/content/compression/#compression-between-cloudflare-and-website-visitors), which depends on the response content type. If you include `none`, `default`, or `auto` in the list, it must be the last value in the list. 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. :::note -The compression applied by the `default` algorithm takes into account global configuration settings such as [Enable Brotli compression](/speed/optimization/content/brotli/). +The compression applied by the `default` algorithm takes into account global configuration settings such as [Enable Brotli compression](/speed/optimization/content/compression/). ::: For API examples, refer to the [Examples gallery](/rules/compression-rules/examples/). diff --git a/src/content/docs/speed/optimization/content/brotli/enable.mdx b/src/content/docs/speed/optimization/content/brotli/enable.mdx deleted file mode 100644 index ae9a4970b5520a8..000000000000000 --- a/src/content/docs/speed/optimization/content/brotli/enable.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -pcx_content_type: how-to -title: Enable -sidebar: - order: 1 -head: - - tag: title - content: Enable Brotli ---- - -import { Render } from "~/components"; - -:::caution - -Brotli compression will be enabled by default for all zones on 2024-08-15. The Brotli setting will be gradually removed until then. - -Enterprise customers can override Cloudflare's default compression behavior using [Compression Rules](/rules/compression-rules/). - -::: - -By default, Brotli compression is enabled for domains on Free and Pro plans and disabled for domains on Business and Enterprise plans. - -To enable Brotli compression: - -1. [Log in to the Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and website. -2. Go to **Speed** > **Optimization** > **Content Optimization**. -3. For **Brotli**, toggle the switch to **On**. - ---- - - diff --git a/src/content/docs/speed/optimization/content/brotli/index.mdx b/src/content/docs/speed/optimization/content/brotli/index.mdx deleted file mode 100644 index ecc4bf3cfcd2414..000000000000000 --- a/src/content/docs/speed/optimization/content/brotli/index.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -pcx_content_type: concept -source: https://support.cloudflare.com/hc/en-us/articles/200168396-What-will-Cloudflare-compress- -title: Brotli compression -sidebar: - order: 3 - ---- - -import { DirectoryListing, FeatureTable } from "~/components" - -Cloudflare supports Brotli compression to help speed up page load times for your visitors. - -## Availability - - - -## Resources - - diff --git a/src/content/docs/speed/optimization/content/brotli/content-compression.mdx b/src/content/docs/speed/optimization/content/compression.mdx similarity index 86% rename from src/content/docs/speed/optimization/content/brotli/content-compression.mdx rename to src/content/docs/speed/optimization/content/compression.mdx index cb5dc97920ea90c..857687f164658b2 100644 --- a/src/content/docs/speed/optimization/content/brotli/content-compression.mdx +++ b/src/content/docs/speed/optimization/content/compression.mdx @@ -94,7 +94,7 @@ application/geo+json Cloudflare's global network can deliver content to website visitors using Gzip compression, Brotli compression, Zstandard compression, or no compression, depending on: - The values visitors provide in the `accept-encoding` request header. -- The value of the [Brotli setting](/speed/optimization/content/brotli/) at the zone level. +- The value of the [Brotli setting](/speed/optimization/content/compression/) at the zone level. - Any configured [compression rule](/rules/compression-rules/) that matches incoming requests. For responses with error status codes, Cloudflare will only compress responses if their error status code is `403` or `404`. For successful response status codes, Cloudflare will only compress responses if their status code is `200`. Responses with other status codes will not be compressed. @@ -154,3 +154,17 @@ Cloudflare will take into consideration the `accept-encoding` header value in we --- + +## Compression methods by plan + +### Between visitors and Cloudflare + +By default, Cloudflare uses the following compression methods for content delivery, depending on the zone plan. However, the actual compression applied may also depend on what the visitor's browser requests via the `accept-encoding` header. + +- Free Plan: Content is compressed by default using Zstandard. +- Pro and Business Plans: Content is compressed by default using Brotli. +- Enterprise Plan: Content is compressed by default using Gzip. + +### Between Cloudflare and the origin server + +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. \ No newline at end of file diff --git a/src/content/docs/support/troubleshooting/cloudflare-errors/troubleshooting-other-errors.mdx b/src/content/docs/support/troubleshooting/cloudflare-errors/troubleshooting-other-errors.mdx index e12d80fc3d32a5d..c8a800a9c954a01 100644 --- a/src/content/docs/support/troubleshooting/cloudflare-errors/troubleshooting-other-errors.mdx +++ b/src/content/docs/support/troubleshooting/cloudflare-errors/troubleshooting-other-errors.mdx @@ -35,5 +35,5 @@ Make sure that the field values are respecting the following requirements: [RFC * A compression issue, for example the origin server is serving gzip encoded compressed content but is not updating the `content-length` header, or the origin is serving broken gzip compressed content. -**Resolution**: In this case you can try to disable compression at your origin and rely on Cloudflare to [compress content](/speed/optimization/content/brotli/content-compression/) +**Resolution**: In this case you can try to disable compression at your origin and rely on Cloudflare to [compress content](/speed/optimization/content/compression/) You can also investigate the configuration of your origin server to make sure the compression is working as expected. diff --git a/src/content/plans/index.json b/src/content/plans/index.json index 2c82f802de5d116..21aec3cb8dccab3 100644 --- a/src/content/plans/index.json +++ b/src/content/plans/index.json @@ -2146,7 +2146,7 @@ }, "brotli": { "title": "Brotli compression", - "link": "/speed/optimization/content/brotli/", + "link": "/speed/optimization/content/compression/", "properties": { "availability": { "title": "Availability",