问题原文
原帖链接 · Mike -- No longer here · CC BY-SA 3.0
I can use PHP's gzencode function to set the compression level of data to compress and I want to compress my sitemap files then submit them to google.
Currently my compression level is set to 2 because I believe that's a standard value. The highest level is 9. My question is, will (at least all major) search engines support decoding sitemap files that are gzipped at a higher compression level than 2, if so, what's the highest level?
I don't want to use compression level 9 only to find out a search engine could not process the sitemap.
已采纳解答
原帖链接 · Stephen Ostermiller · CC BY-SA 3.0
All Gzip decompression programs can decompress any of the levels. The compression level doesn't change the format of the output at all.
The compression level is good for managing load on your server. Gzip will spend many more CPU cycles trying to compress the data better when you specify a higher compression level.
In my experience the benefits of higher compression levels are modest at best. The default compression level is almost as good as the higher compression levels and much less intensive during compression.
As a general rule you should use lower compression levels if you are compressing something on the fly. If you are compressing something that will be downloaded thousands of times you could think about using higher compression levels.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
