diff --git a/roles/distgit/templates/lookaside.conf b/roles/distgit/templates/lookaside.conf index 84099b52dc..b0d1c28b1c 100644 --- a/roles/distgit/templates/lookaside.conf +++ b/roles/distgit/templates/lookaside.conf @@ -3,11 +3,16 @@ Alias /lookaside /srv/cache/lookaside Options Indexes FollowSymLinks AllowOverride None Require all granted + {% if env == 'staging' %} - # Disable global mod_deflate for lookaside cache - # to prevent double-compression and false gzip headers - SetEnv no-gzip 1 - SetEnv dont-vary 1 + # Disable mod_mime's automatic Content-Encoding for archives + RemoveEncoding .gz .tgz .bz2 .xz .zst .lzma .crate + + # Force all lookaside files to be served as generic binary data. + # This prevents mod_mime_magic from sniffing .crate files and adding x-gzip encoding. + ForceType application/octet-stream + + # Explicitly remove Content-Encoding just to be absolutely sure + Header unset Content-Encoding {% endif %} -