Skip to content

Instantly share code, notes, and snippets.

@cindreta
Created Sep 5, 2021
Embed
What would you like to do?
Enable GZIP Encoding for all application/json responses
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE "application/javascript" \
"application/json" \
"application/ld+json" \
"application/manifest+json" \
"application/schema+json" \
"application/geo+json" \
"application/x-javascript" \
</IfModule>
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment