Questions tagged [gzip]

GZip/gzip is both the name for a compressed data format and any of several software applications implementing this format. Use this tag for questions about implementing the library on your program.

gzip is the name for the compressed data format used by the eponymous GZip application for compressing and decompressing data.

The format is based on the deflate compressed data format, with the addition of a file metadata header and a CRC32 checksum. It is defined in RFC 1952. It is commonly used to compress HTTP requests and responses, and also often combined with the tar format for archival.

The most known standalone command-line implementation is GNU zip. The format is also implemented by the zlib library, and in this form used in many applications.

GZip on Wikipedia

6057 questions
137
votes
13 answers

Gzip versus minify

I had a somewhat lively discussion the other day about minifying Javascript and CSS versus someone who prefers using Gzip. I'll call this person X. X said that Gzip allready minifies the code, since it zips your files. I disagree. Zip is a lossless…
KdgDev
  • 14,299
  • 46
  • 120
  • 156
136
votes
8 answers

How to check if a Unix .tar.gz file is a valid file without uncompressing?

I have found the question How to determine if data is valid tar file without a file?, but I was wondering: is there a ready made command line solution?
understack
  • 11,212
  • 24
  • 77
  • 100
130
votes
9 answers

How to extract filename.tar.gz file

I want to extract an archive named filename.tar.gz. Using tar -xzvf filename.tar.gz doesn't extract the file. it is gives this error: gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error exit delayed from previous errors
Kabir
  • 2,126
  • 5
  • 21
  • 24
126
votes
4 answers

Decompressing GZip Stream from HTTPClient Response

I am trying to connect to an api, that returns GZip encoded JSON, from a WCF service (WCF service to WCF service). I am using the HTTPClient to connect to the API and have been able to return the JSON object as a string. However I need to be able to…
Corey
  • 1,733
  • 4
  • 18
  • 26
122
votes
3 answers

How can I decompress a gzip stream with zlib?

Gzip format files (created with the gzip program, for example) use the "deflate" compression algorithm, which is the same compression algorithm as what zlib uses. However, when using zlib to inflate a gzip compressed file, the library returns a…
Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
118
votes
8 answers

Using GZIP compression with Spring Boot/MVC/JavaConfig with RESTful

We use Spring Boot/MVC with annotation-based java-config for series of RESTful services and we want to selectively enable HTTP GZIP stream compression on some API responses. I know I can do this manually in my controller and a byte[] @ResponseBody,…
user3182614
  • 1,241
  • 2
  • 10
  • 5
116
votes
3 answers

Writing then reading in-memory bytes (BytesIO) gives a blank result

I wanted to try out the python BytesIO class. As an experiment I tried writing to a zip file in memory, and then reading the bytes back out of that zip file. So instead of passing in a file-object to gzip, I pass in a BytesIO object. Here is the…
twasbrillig
  • 17,084
  • 9
  • 43
  • 67
114
votes
4 answers

Fast Concatenation of Multiple GZip Files

I have list of gzip files: file1.gz file2.gz file3.gz Is there a way to concatenate or gzipping these files into one gzip file without having to decompress them? In practice we will use this in a web database (CGI). Where the web will receive a…
neversaint
  • 60,904
  • 137
  • 310
  • 477
111
votes
2 answers

Transfer-Encoding: gzip vs. Content-Encoding: gzip

What is the current state of affairs when it comes to whether to do Transfer-Encoding: gzip or a Content-Encoding: gzip when I want to allow clients with e.g. limited bandwidth to signal their willingness to accept a compressed response and the…
Evgeniy Berezovsky
  • 18,571
  • 13
  • 82
  • 156
110
votes
10 answers

How to 'minify' Javascript code

JQuery has two versions for download, one is Production (19KB, Minified and Gzipped), and the other is Development (120KB, Uncompressed Code). Now the compact 19kb version, if you download it, you will see is still a javascript executable code. How…
KalEl
  • 8,978
  • 13
  • 47
  • 56
110
votes
5 answers

Android: HTTP communication should use "Accept-Encoding: gzip"

I've a HTTP communication to a webserver requesting JSON data. I'd like compress this data stream with Content-Encoding: gzip. Is there a way I can set Accept-Encoding: gzip in my HttpClient? The search for gzip in the Android References doesn't…
znq
  • 44,613
  • 41
  • 116
  • 144
106
votes
6 answers

How to get few lines from a .gz compressed file without uncompressing

How to get the first few lines from a gziped file ? I tried zcat, but its throwing an error zcat CONN.20111109.0057.gz|head CONN.20111109.0057.gz.Z: A file or directory in the path name does not exist.
Govind Kailas
  • 2,645
  • 5
  • 22
  • 24
106
votes
13 answers

Node.js: Gzip compression?

Am I wrong in finding that Node.js does no gzip compression and there are no modules out there to perform gzip compression? How can anyone use a web server that has no compression? What am I missing here? Should I try to—gasp—port the algorithm to…
SnickersAreMyFave
  • 5,047
  • 8
  • 26
  • 24
104
votes
7 answers

I want to create a script for unzip (.tar.gz) file via (Python)

I am trying to make a script for unzipping all the .tar.gz files from folders in one directory. For example, I will have a file which it calls ( testing.tar.gz). Then if I do manually, I can press to "extract here" then the .tar.gz file will create…
Alex
  • 1,097
  • 2
  • 9
  • 12
103
votes
3 answers

How do I enable gzip compression when using MVC3 on IIS7?

Does anybody know how to enable gzip compression in MVC 3? I'm using IIS7. Google Chrome Audit's result: Enable gzip compression (4) Compressing the following resources with gzip could reduce their transfer size by about two thirds (~92.23KB): …
imarkic84
  • 1,031
  • 2
  • 8
  • 3