Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ You must specify at least one option. Options are comma-separated (spaces are no

<Render file="sharpen" />

### `slow-connection-quality`

<Render file="slow-connection-quality" />

### `trim`

<Render file="trim" />
Expand Down Expand Up @@ -165,4 +169,4 @@ If Custom Cache Keys are used for the origin image, the origin image might not b

Resized images follow the same caching rules as the original image they were resized from, except the minimum cache time is one hour. If you need images to be updated more frequently, add `must-revalidate` to the `Cache-Control` header. Resizing supports cache revalidation, so we recommend serving images with the `Etag` header. Refer to the [Cache docs for more information](/cache/concepts/cache-control/#revalidation).

Cloudflare Images does not support purging resized variants individually. URLs starting with `/cdn-cgi/` cannot be purged. However, purging of the original image's URL will also purge all of its resized variants.
Cloudflare Images does not support purging resized variants individually. URLs starting with `/cdn-cgi/` cannot be purged. However, purging of the original image's URL will also purge all of its resized variants.
43 changes: 43 additions & 0 deletions src/content/partials/images/slow-connection-quality.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
{}
---
import { Tabs, TabItem } from "~/components"

:::note[Note]
At the moment, this setting only works directly with [image transformations](/images/transform-images/).
:::

Allows overriding `quality` value whenever a slow connection is detected.

Available options are same as [quality](/images/transform-images/transform-via-url/#quality).

<Tabs>
<TabItem label="URL format">
```js
slow-connection-quality=50
```
</TabItem>
<TabItem label="URL format alias">
```js
scq=50
```
</TabItem>
</Tabs>

Detecting slow connections is currently only supported on Chromium-based browsers such as Chrome, Edge, and Opera.

You can enable any of the following client hints via HTTP in a header

```txt
accept-ch: rtt, save-data, ect, downlink
```

slow-connection-quality applies whenever any of the following is true and the client hint is present:

- [rtt](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/RTT): Greater than 150ms.

- [save-data](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Save-Data): Value is "on".

- [ect](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ECT): Value is one of `slow-2g|2g|3g`.

- [downlink](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Downlink): Less than 5Mbps.