RFC 9659: Window Sizing for Zstandard Content Encoding
- N. Jaju, Ed.,
- W. F. Handte, Ed.
Abstract
Deployments of Zstandard, or "zstd", can use different window
sizes to limit memory usage during compression and decompression. Some
browsers and user agents limit window sizes to mitigate memory usage
concerns, thereby causing interoperabilit
Status of This Memo
This document is not an Internet Standards Track specification; it is published for informational purposes.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Not all documents approved by the IESG are candidates for any level of Internet Standard; see Section 2 of RFC 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https://
Copyright Notice
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://
1. Introduction
Zstandard, or "zstd", specified in [RFC8878], is a lossless data compression
mechanism similar to gzip. When used with HTTP, the "zstd" content coding
token signals to the decoder that the content is Zstandard
An important property of Zstandard
The minimum Window_Size is 1 KB. The maximum Window_Size is (1<<41) + 7*(1<<38) bytes, where "<<" denotes a bitwise left shift, which is 3.75 TB. Larger Window_Size values tend to improve the compression ratio but at the cost of increased memory usage.¶
To protect against unreasonable memory usage, some browsers and user agents
limit the maximum Window_Size they will handle. This causes failures to decode
responses when the content is compressed with a larger Window_Size than the
recipient allows, leading to decreased interoperabilit
[RFC8878], Section 3.1.1.1.2 recommends that decoders support a Window_Size of up to 8 MB, and that encoders not generate frames using a Window_Size larger than 8 MB. However, it imposes no requirements.¶
This document updates [RFC8878] to enforce Window_Size limits on the encoder and decoder for the "zstd" HTTP content coding.¶
2. Conventions and Definitions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
3. Window Size
To ensure interoperabilit
4. Security Considerations
This document introduces no new security considerations beyond those discussed in [RFC8878].¶
Note that decoders still need to take into account that they can receive oversized frames that do not follow the window size limit specified in this document and fail decoding when such invalid frames are received.¶
5. IANA Considerations
5.1. Content Encoding
This document updates the following entry in the "HTTP Content Coding Registry" in the "Hypertext Transfer Protocol (HTTP) Parameters" registry group:¶
6. Normative References
- [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174 - [RFC8878]
-
Collet, Y. and M. Kucherawy, Ed., "Zstandard Compression and the 'application
/zstd' Media Type" , RFC 8878, DOI 10.17487 , , <https:///RFC8878 www >..rfc -editor .org /info /rfc8878
Acknowledgments
Zstandard was developed by Yann Collet.¶
The authors would like to thank Yann Collet, Klaus Post, Adam Rice, and members of the Web Performance Working Group in the W3C for collaborating on the window size issue and helping to formulate a solution.¶