Home » Questions » Computers [ Ask a new question ]

Does it take longer to download a zipped file than an unzipped file?

Does it take longer to download a zipped file than an unzipped file?

I once read somewhere that it takes longer to download a zipped file than an unzipped file of the same size, due to the nature of the zip file.

Asked by: Guest | Views: 27
Total answers/comments: 5
Guest [Entry]

"When the connection is using compression, then of course.

You cannot efficiently compress data 2 times. So when compression is turned on, a 1 MB zip file will be transferred slower then a 1 MB txt file.

NB: This is dependent on the transfer protocol. FTP or other protocols don't have built-in compression. HTTP has."
Guest [Entry]

"If you use a PPP (dial-up or VPN) connection with compression, zipped files may download with lower speed than text files due to their nature (the former are already compressed and the latter will be compressed by the protocol thus increasing measured speed).

But if you compare amounts of information you receive, downloading zipped files will still be more efficient because any file archiver is usually superior to link-layer compression. So a zipped text file will be downloaded faster than the same text file verbatim, even if compression increases download speed a little."
Guest [Entry]

Not sure if this is related or not, but if you download one zipped file (zipped without compression) it's faster than downloading the same package as multiple (unzipped) files, due to the HTTP request overhead required before starting to download each individual file.
Guest [Entry]

"Practical Answer: the purpose of zipping up your files is to make them easier to
share (i.e.download) with other people. Zipping works by compression, which means 'shrinking files' in common english.

Computer software is not perfect, and there may be weird edge cases where zipping a file would make it slightly larger and harder to share. Finding these edge cases where zipping fails will likely bore you to tears and is not worth your time.

Hypothetical Answer: It's very complicated. The answer would depend on the zip program, transmission protocols, file size, file type, maybe even the browser type or antivirus software running on the client computer. In other words, ""it depends."""
Guest [Entry]

"The answer is actually ""it depends"" : Depending on the format that the web-server chooses to send the file.

If the server generates the answer with binary as-is bytes, than equal-sized zipped and unzipped files will download in the same speed.

If the server generates a response in Base64 encoding, then it increases the number of the bytes and the zipped file will take longer to download. Most modern web-servers do not do that any more, although it used to be quite prevalent a few years ago.

To explain, base64 format is a stream of 6-bit displayable characters. That means, for example, that 6 binary bytes, which are 6*8=48 bits, are encoded as 48/6=8 characters. In general, for n binary bytes, the number of base64 characters that are sent is (n * 8) / 6. So sending n binary bytes is slower than sending n textual bytes by 33% (8 divided by 6), because more characters are sent."