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.
Is this true or nonsense?
edit: i'm speaking about HTTP traffic
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.
Is this true or nonsense?
edit: i'm speaking about HTTP traffic
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.
It's not true if you are downloading via standard FTP or HTTP. For other connection types see Christopher's answer.
Assuming the same connection the speed of download is determined by the size of the file.
There might be a delay at the end of the download if you have automatic virus checking enabled as it will have to open and unpack the zip file to check the contents rather than being able to check the file directly.
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.
you must notice it's has no difference in HTTP protocol because in server and in router they use GZIP to zip packet and then send therefor if you zip or non they act the same.
As already mentioned, HTTP traffic can be compressed, but it isn't always.
You may have read this at a time when people used phone modems instead of adsl/cable modems. In this situation, the text was compressed before sending or receiving, so your text file would have been sent faster.
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.
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."
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.