Media type / application
application/gzip
Gzip-compressed files as a payload in their own right, distinct from gzip used as a transfer encoding.
Served inline: Browsers have no renderer for this, so it downloads even without a Content-Disposition header. That makes it the quiet default for anything you do not want opened in place.
Browser behaviour
Downloads
Charset
no charset
Compression
Already compressed
Send it like this
Content-Type: application/gzipA binary payload has no character encoding. A charset parameter here is meaningless and occasionally confuses strict parsers.
Handling verdict
Browsers have no renderer for this, so it downloads even without a Content-Disposition header. That makes it the quiet default for anything you do not want opened in place.
A binary payload has no character encoding. A charset parameter here is meaningless and occasionally confuses strict parsers.
The format compresses internally. Another transport encoding costs CPU on both ends and typically changes the size by less than a percent — sometimes upward.
Registered with IANA through a public review process, so the name is stable and every implementation can rely on it meaning the same thing.
Anatomy of the name
RFC 6838Top-level type
application
Application
Subtype
gzip
Registered in the standards tree.
Structured syntax
none
No suffix, so the payload format is defined entirely by the subtype itself.
Parameters
none
Beyond the charset rule above, this type defines no parameters of its own.
What trips people up
1 note- Content-Type: application/gzip means the resource is a gzip file. Content-Encoding: gzip means it was compressed for transport and should be decoded on arrival — conflating the two produces a file that downloads as .gz and will not open.
Response headers
Content-Type: application/gzip
X-Content-Type-Options: nosniff
Content-Disposition: attachment; filename="example.gz"nosniff stops the browser second-guessing the type you declared, which is what makes the rest of this reliable. Content-Disposition: attachment names the saved file and removes any doubt about rendering.
Server configuration
extension mappingnginx
types {
application/gzip gz tgz;
}Apache
AddType application/gzip .gz .tgzCaddy
@type path *.gz *.tgz
header @type Content-Type "application/gzip"Extensions and other spellings
with signatureFile extensions
Also written as
These reach the same handler in practice. Accept them on input; send application/gzip on output.
File signature
1F 8B
Check these bytes rather than the client-supplied Content-Type when validating an upload. The header is a claim; the signature is evidence.