Skip to content

Commit

Permalink
Add Zstandard (zstd) and mark Brotli as standard (mdn#32465)
Browse files Browse the repository at this point in the history
* Add Zstandard (zstd) and mark Brotli as standard

* Remove non-standard from accept-encoding

* Add glossary entry

* Wording

* Update files/en-us/web/http/headers/content-encoding/index.md

Co-authored-by: Brian Thomas Smith <[email protected]>

* Update files/en-us/glossary/zstandard_compression/index.md

Co-authored-by: Brian Thomas Smith <[email protected]>

* Update files/en-us/glossary/zstandard_compression/index.md

Co-authored-by: Brian Thomas Smith <[email protected]>

* Add glossary links

* Fix capitlaisation

* Fix links and add redirects

* Fix linting

---------

Co-authored-by: Brian Thomas Smith <[email protected]>
  • Loading branch information
tunetheweb and bsmth authored Mar 4, 2024
1 parent 006c46c commit ad2254c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 3 deletions.
2 changes: 2 additions & 0 deletions files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3569,6 +3569,7 @@
/en-US/docs/Glossary/Block/Block_(CSS) /en-US/docs/Glossary/Block/CSS
/en-US/docs/Glossary/Block/Block_(scripting) /en-US/docs/Glossary/Block/Scripting
/en-US/docs/Glossary/Boot2Gecko /en-US/docs/Glossary/Firefox_OS
/en-US/docs/Glossary/Brotli /en-US/docs/Glossary/Brotli_compression
/en-US/docs/Glossary/Bézier_curve /en-US/docs/Glossary/Bezier_curve
/en-US/docs/Glossary/CSS_property /en-US/docs/Glossary/property/CSS
/en-US/docs/Glossary/Cleartext /en-US/docs/Glossary/Plaintext
Expand All @@ -3581,6 +3582,7 @@
/en-US/docs/Glossary/Empty_element /en-US/docs/Glossary/Void_element
/en-US/docs/Glossary/Error /en-US/docs/Glossary/Exception
/en-US/docs/Glossary/First_interactive /en-US/docs/Glossary/First_CPU_idle
/en-US/docs/Glossary/GZip /en-US/docs/Glossary/GZip_compression
/en-US/docs/Glossary/Global_attribute /en-US/docs/Web/HTML/Global_attributes
/en-US/docs/Glossary/Grid_Rows /en-US/docs/Glossary/Grid_Row
/en-US/docs/Glossary/Hash_function /en-US/docs/Glossary/Cryptographic_hash_function
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/glossary/brotli_compression/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Brotli
title: Brotli compression
slug: Glossary/Brotli_compression
page-type: glossary-definition
---
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/glossary/lossless_compression/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: glossary-definition

{{GlossarySidebar}}

**Lossless compression** is a class of data compression algorithms that allows the original data to be perfectly reconstructed from the compressed data. Lossless compression methods are reversible. Examples of lossless compression include {{glossary("GZIP")}}, {{glossary("Brotli")}}, WebP, and {{glossary("PNG")}},
**Lossless compression** is a class of data compression algorithms that allows the original data to be perfectly reconstructed from the compressed data. Lossless compression methods are reversible. Examples of lossless compression include {{glossary("GZip_compression", "gzip")}}, {{glossary("Brotli_compression", "brotli")}}, {{glossary("WebP")}}, and {{glossary("PNG")}},

{{glossary("Lossy compression")}}, on the other hand, uses inexact approximations by discarding some data from the original file, making it an irreversible compression method.

Expand Down
21 changes: 21 additions & 0 deletions files/en-us/glossary/zstandard_compression/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Zstandard compression
slug: Glossary/Zstandard_compression
page-type: glossary-definition
---

{{GlossarySidebar}}

**Zstandard** is a general-purpose lossless compression algorithm.

Zstandard, or `zstd` as short version, is a fast lossless compression algorithm, targeting real-time compression scenarios at zlib-level and better compression ratios. It's backed by a very fast entropy stage, provided by [Huff0 and FSE library](https://github.com/Cyan4973/FiniteStateEntropy). It often offers better compression ratios than {{glossary("Brotli_compression", "brotli")}} at equivalent CPU costs, or better CPU costs at equivalent compression ratios.

For browser support, see [Content-Encoding: Browser compatibility](/en-US/docs/Web/HTTP/Headers/Content-Encoding#browser_compatibility).

## See also

- [Zstandard RFC](https://tools.ietf.org/html/rfc8878)
- [Zstandard home page](https://facebook.github.io/zstd/)
- [Zstandard GitHub repository](https://github.com/facebook/zstd)
- [Zstandard](https://en.wikipedia.org/wiki/Zstandard) on Wikipedia
- [Zstandard on Caniuse](https://caniuse.com/#feat=zstandard)
8 changes: 8 additions & 0 deletions files/en-us/web/http/headers/accept-encoding/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Accept-Encoding: gzip
Accept-Encoding: compress
Accept-Encoding: deflate
Accept-Encoding: br
Accept-Encoding: zstd
Accept-Encoding: identity
Accept-Encoding: *
Expand All @@ -58,6 +59,8 @@ Accept-Encoding: deflate, gzip;q=1.0, *;q=0.5
- : A compression format that uses the [zlib](https://en.wikipedia.org/wiki/Zlib) structure with the [_deflate_](https://en.wikipedia.org/wiki/DEFLATE) compression algorithm.
- `br`
- : A compression format that uses the [Brotli](https://en.wikipedia.org/wiki/Brotli) algorithm.
- `zstd`
- : A compression format that uses the [Zstandard](https://en.wikipedia.org/wiki/Zstd) algorithm.
- `identity`
- : Indicates the identity function (that is, without modification or compression). This value is always considered as acceptable, even if omitted.
- `*`
Expand All @@ -72,6 +75,8 @@ Accept-Encoding: gzip
Accept-Encoding: gzip, compress, br
Accept-Encoding: gzip, compress, br, zstd
Accept-Encoding: br;q=1.0, gzip;q=0.8, *;q=0.1
```

Expand All @@ -88,3 +93,6 @@ Accept-Encoding: br;q=1.0, gzip;q=0.8, *;q=0.1
- HTTP [content negotiation](/en-US/docs/Web/HTTP/Content_negotiation)
- A header with the result of the content negotiation: {{HTTPHeader("Content-Encoding")}}
- Other similar headers: {{HTTPHeader("TE")}}, {{HTTPHeader("Accept")}}, {{HTTPHeader("Accept-Language")}}
- {{Glossary("Brotli compression")}}
- {{Glossary("GZip compression")}}
- {{Glossary("Zstandard compression")}}
8 changes: 7 additions & 1 deletion files/en-us/web/http/headers/content-encoding/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Content-Encoding: gzip
Content-Encoding: compress
Content-Encoding: deflate
Content-Encoding: br
Content-Encoding: zstd
// Multiple, in the order in which they were applied
Content-Encoding: deflate, gzip
Expand All @@ -59,7 +60,9 @@ Content-Encoding: deflate, gzip
structure (defined in {{rfc(1950)}}) with the [deflate](https://en.wikipedia.org/wiki/Deflate) compression
algorithm (defined in {{rfc(1951)}}).
- `br`
- : A format using the [Brotli](https://en.wikipedia.org/wiki/Brotli) algorithm.
- : A format using the [Brotli](https://en.wikipedia.org/wiki/Brotli) algorithm structure (defined in {{rfc(7932)}}).
- `zstd` {{experimental_inline}}
- : A format using the [Zstandard](https://en.wikipedia.org/wiki/Zstd) algorithm structure (defined in {{rfc(8878)}}).

## Examples

Expand Down Expand Up @@ -95,3 +98,6 @@ depends on server settings and used server modules.

- {{HTTPHeader("Accept-Encoding")}}
- {{HTTPHeader("Transfer-Encoding")}}
- {{Glossary("Brotli compression")}}
- {{Glossary("GZip compression")}}
- {{Glossary("Zstandard compression")}}

0 comments on commit ad2254c

Please sign in to comment.