In request header, we have accept-encoding: gzip
, but got response with encoding x-gzip
.
I found this note about x-gzip and gzip:
Use of program names for the identification of encoding formats is not desirable and is discouraged for future encodings. Their use here is representative of historical practice, not good design. For compatibility with previous implementations of HTTP, applications SHOULD consider "x-gzip" and "x-compress" to be equivalent to "gzip" and "compress" respectively.
Does it mean x-gzip
is equal to gzip
? We can simply use the same way to unzip x-gzip
content as gzip
content?
Gzip is a file format and software application used on Unix and Unix-like systems to compress HTTP content before it's served to a client.
The “content-encoding: gzip” HTTP Response Header You can open up Chrome DevTools or Firefox Developer Tools and look for this response header under the Network section.
The browser sends a header telling the server it accepts compressed content (gzip and deflate are two compression schemes): Accept-Encoding: gzip, deflate. The server sends a response if the content is actually compressed: Content-Encoding: gzip.
When gzip is enabled you will see 'Content-Encoding: gzip' in the output: Note: If the website has a www redirection, change the website name to www.example.com. Connect to a server via SSH. To disable gzip compression, open the corresponding file in a text editor and change gzip on to gzip off .
x-gzip
and gzip
are equivalent.
The content you receive can be unzipped the same way for both.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With