请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

压缩和未压缩的文件大小没有区别

使用的chrome浏览器,比较了压缩前和压缩后的文件,没有大小上的改变。有的甚至压缩后比未压缩的还要大一点点。不知道为什么。

https://img1.sycdn.imooc.com/szimg/59e322a50001327f05190298.jpg

https://img1.sycdn.imooc.com/szimg/59e322a50001221a05360326.jpg

是因为chrome浏览器自带就有压缩功能吗?

正在回答 回答被采纳积分+3

6回答

Samaritan 2017-11-26 10:09:13

https://stackoverflow.com/questions/20762094/how-are-zlib-gzip-and-zip-related-what-do-they-have-in-common-and-how-are-they/20765054#20765054

0 回复 有任何疑惑可以回复我~
Samaritan 2017-11-26 10:09:00


   

There is no direct correlation between file size and compressed size.

I.e. sample for RLE compression (much worse than GZIP, but easier to show idea):

File 1: {0,0,0,0} 4 bytes compresses to approximately 2 bytes {4,0}

File 2: {1,2,3,4} 4 bytes grows to approximately 8 bytes instead of compression {1,1,1,2,1,3,1,4}

In general more random data is in the file than less compressible file is.

For compiled binaries different options may trigger extra tables to be included (like source locations) or use different (ASCII vs. UTF-16) string representation - all this may change amount of repetition in the file that compression can use to actually compress binaries.

   


0 回复 有任何疑惑可以回复我~
圣歌奏 2017-11-26 00:07:31

我的也没有变换,我的连content-encoding都没在响应头中出现

0 回复 有任何疑惑可以回复我~
Delucia 2017-11-22 09:58:02

同样..

0 回复 有任何疑惑可以回复我~
蓝with黑 2017-11-20 21:33:07

我也是。没变,不知道为啥

0 回复 有任何疑惑可以回复我~
Samaritan 2017-10-15 17:14:04

是不是用的文件太小了?看个稍微大一些的文件试试

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信