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.


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.