Skip to content

Commit c30002a

Browse files
authored
Adding slow-connection-quality parameter (#20803)
* Adding slow-connection-quality parameter * Tweak description for chromium based
1 parent a99584e commit c30002a

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

src/content/docs/images/transform-images/transform-via-url.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ You must specify at least one option. Options are comma-separated (spaces are no
123123

124124
<Render file="sharpen" />
125125

126+
### `slow-connection-quality`
127+
128+
<Render file="slow-connection-quality" />
129+
126130
### `trim`
127131

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

166170
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).
167171

168-
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.
172+
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.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
{}
3+
---
4+
import { Tabs, TabItem } from "~/components"
5+
6+
:::note[Note]
7+
At the moment, this setting only works directly with [image transformations](/images/transform-images/).
8+
:::
9+
10+
Allows overriding `quality` value whenever a slow connection is detected.
11+
12+
Available options are same as [quality](/images/transform-images/transform-via-url/#quality).
13+
14+
<Tabs>
15+
<TabItem label="URL format">
16+
```js
17+
slow-connection-quality=50
18+
```
19+
</TabItem>
20+
<TabItem label="URL format alias">
21+
```js
22+
scq=50
23+
```
24+
</TabItem>
25+
</Tabs>
26+
27+
Detecting slow connections is currently only supported on Chromium-based browsers such as Chrome, Edge, and Opera.
28+
29+
You can enable any of the following client hints via HTTP in a header
30+
31+
```txt
32+
accept-ch: rtt, save-data, ect, downlink
33+
```
34+
35+
slow-connection-quality applies whenever any of the following is true and the client hint is present:
36+
37+
- [rtt](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/RTT): Greater than 150ms.
38+
39+
- [save-data](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Save-Data): Value is "on".
40+
41+
- [ect](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ECT): Value is one of `slow-2g|2g|3g`.
42+
43+
- [downlink](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Downlink): Less than 5Mbps.

0 commit comments

Comments
 (0)