SOP: Serve a gzipped sitemap without breaking it
Gzipping is fine — serving it wrong makes Google download garbage. Rules:
— ✅ File extension .xml.gz
— ✅ Sent with Content-Encoding: gzip (so it's decompressed once) — OR served as a static .gz with Content-Type: application/gzip and NO Content-Encoding
— ✅ Never both: double-gzip (transfer encoding on an already-gz file) yields an undecodable stream
— ✅ Uncompressed payload still ≤ 50 MB and ≤ 50,000 URLs
The double-compression bug shows in GSC as "could not read" with a valid-looking file. Test by fetching with an unaware client.
Command: curl -s url.xml.gz | gunzip | head -c 50 must print <?xml.
Definition of done: that one-liner prints readable XML on the first decompress.
The Sitemap SOP
@SitemapSOP
SOP: Serve a gzipped sitemap without breaking it
Этот пост опубликован в Telegram-канале The Sitemap SOP. Подписаться можно по ссылке: @SitemapSOP.