GZip or Deflate for HTTP compression

一世执手 提交于 2019-12-10 06:37:26

问题


Which compression method is better? I've heard lots of back and forth about GZip being more widely used, but Deflate being faster (in some instances). Is there an accepted standard on which one to use and why?


回答1:


UPDATE

According to the latest updates to the linked question, one should use GZip. See http://www.vervestudios.co/projects/compression-tests/results

Old Answer

Deflate is better.




回答2:


Answers:

  • http://www.stardeveloper.com/articles/display.html?article=2008111201&page=1
  • http://blog.usweb.com/archives/mod_deflate-vs-mod_gzip-comparing-the-two/
  • Why use deflate instead of gzip for text files served by Apache?

Basically, deflate is faster, so if it's avaible to you, use it.




回答3:


As I have written here: HTTP_compression - Wikipedia

deflate - despite its name the zlib compression (RFC 1950) should be used (in combination with the deflate compression (RFC 1951)) as described in the RFC 2616. The implementation in the real world however seems to vary between the zlib compression and the (raw) deflate compression[3][4]. Due to this confusion, gzip has positioned itself as the more reliable default method (March 2011).

gzip and zlib are file/stream formats that by default wrap around deflate and amongst other things add a checksum which make them more secure and a little slower. The increase in size on the other hand should not be of any concern.



来源:https://stackoverflow.com/questions/4725700/gzip-or-deflate-for-http-compression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!