You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/02_concepts/13_http_compression.mdx
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,13 +19,14 @@ The client compresses request bodies using the compressor configured via the `co
19
19
20
20
## Already-compressed payloads
21
21
22
-
Some payloads carry their own compression, so compressing them again costs CPU and memory while typically making the request slightly larger. The client skips compression when the request's `Content-Type` is one of these:
22
+
Some payloads carry their own compression, so compressing them again costs CPU and memory while making the request slightly larger. The client skips compression when the request's `Content-Type` is one of these:
23
23
24
-
- any `image/*`, `audio/*`, or `video/*` type,
25
-
- archives such as `application/zip`, `application/gzip`, or `application/x-7z-compressed`,
26
-
- web fonts (`font/woff`, `font/woff2`).
24
+
- any `image/*`, `audio/*`, or `video/*` type
25
+
- archives such as `application/zip`, `application/gzip`, or `application/x-7z-compressed`
26
+
- office documents and packages built on ZIP, such as `.docx`, `.xlsx`, `.epub`, or `.apk`
27
+
- web fonts (`font/woff`, `font/woff2`)
27
28
28
-
Text-based types are still compressed even under those prefixes, so`image/svg+xml` is compressed as usual. Set an accurate `content_type` when uploading media to a key-value store to benefit from this:
29
+
Two kinds of media type are compressed anyway: raw formats such as`image/bmp`, `image/tiff`, and `audio/wav`, and subtypes with a structured syntax suffix such as `image/svg+xml`. Set an accurate `content_type` when uploading media to a key-value store:
@@ -40,7 +41,7 @@ Text-based types are still compressed even under those prefixes, so `image/svg+x
40
41
</TabItem>
41
42
</Tabs>
42
43
43
-
Without an explicit content type the record is sent as `application/octet-stream`, which the client cannot tell apart from uncompressed binary data and therefore still compresses.
44
+
Without an explicit content type, a `bytes` value is sent as `application/octet-stream`, which the client can't tell apart from uncompressed binary data and therefore still compresses. File-like values are streamed rather than buffered, so they're never compressed regardless of their content type.
0 commit comments