HTTP compression: Difference between revisions

Content deleted Content added
Citation bot (talk | contribs)
Alter: publisher. Add: website. | Use this bot. Report bugs. | Suggested by Neko-chan | Category:Hypertext Transfer Protocol | #UCB_Category 14/43
Wdpp (talk | contribs)
Update the RFC links, and added link to the RFC 9110,
Line 8:
 
==Compression scheme negotiation==
The negotiation is done in two steps, described in RFC 2616 and RFC 9110:
 
1. The [[web client]] advertises which compression schemes it supports by including a list of tokens in the [[HTTP request]]. For ''Content-Encoding'', the list is in a field called ''Accept-Encoding''; for ''Transfer-Encoding'', the field is called ''TE''.
Line 35:
The official list of tokens available to servers and client is maintained by IANA,<ref>{{cite web|url=https://www.iana.org/assignments/http-parameters/http-parameters.xhtml#content-coding|title=Hypertext Transfer Protocol Parameters - HTTP Content Coding Registry|publisher=IANA|access-date=18 April 2014}}</ref> and it includes:
 
*br – [[Brotli]], a compression algorithm specifically designed for HTTP content encoding, defined in RFC{{IETF RFC|7932|link=no}} and implemented in all modern major browsers.
*[[compress]] – UNIX "compress" program method (historic; deprecated in most applications and replaced by gzip or deflate)
*deflate – compression based on the [[DEFLATE|deflate]] algorithm (described in RFC{{IETF RFC|1951|link=no}}), a combination of the [[LZ77_and_LZ78#LZ77|LZ77]] algorithm and Huffman coding, wrapped inside the [[zlib]] data format (RFC{{IETF RFC|1950|link=no}});
*exi – W3C [[Efficient XML Interchange]]
*[[gzip]] – GNU zip format (described in RFC{{IETF RFC|1952|link=no}}). Uses the [[DEFLATE|deflate]] algorithm for compression, but the data format and the checksum algorithm differ from the "deflate" content-encoding. This method is the most broadly supported as of March 2011.<ref>{{cite web|url=http://www.vervestudios.co/projects/compression-tests/results|title=Compression Tests: Results|publisher=Verve Studios, Co|archive-url=https://web.archive.org/web/20120321182910/http://www.vervestudios.co/projects/compression-tests/results|archive-date=21 March 2012|access-date=19 July 2012}}</ref>
*[[Identity function|identity]] – No transformation is used. This is the default value for content coding.
*[[Pack200|pack200-gzip]] – Network Transfer Format for Java Archives<ref>{{cite web|url=https://jcp.org/en/jsr/detail?id=200|title=JSR 200: Network Transfer Format for Java Archives|publisher=The Java Community Process Program}}</ref>
*[[zstd]] – Zstandard compression, defined in RFC{{IETF RFC|8478|link=no}}
 
In addition to these, a number of unofficial or non-standardized tokens are used in the wild by either servers or clients:
Line 101:
 
==External links==
*RFC{{IETF RFC|2616|link=no}}: Hypertext Transfer Protocol – HTTP/1.1
*{{IETF RFC|9110|link=no}}: HTTP Semantics
*[https://www.iana.org/assignments/http-parameters HTTP Content-Coding Values] by Internet Assigned Numbers Authority
*[http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:Modcompress Compression with lighttpd]