-
-
Save ionurboz/61a626f0c7e743e636bf73f6b518add5 to your computer and use it in GitHub Desktop.
htaccess gzip/brotli-bomb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
<IfModule mod_headers.c> | |
RewriteCond %{HTTP:Accept-encoding} br | |
RewriteCond %{REQUEST_FILENAME} wp-login.php | |
RewriteRule ^(.*)$ bomb-32G.brotli [QSA] | |
RewriteCond %{HTTP:Accept-encoding} gzip | |
RewriteCond %{REQUEST_FILENAME} wp-login.php | |
RewriteRule ^(.*)$ bomb-10G.gzip [QSA] | |
# Set content type, and prevent mod_deflate double compression. | |
RewriteRule bomb-[\d]+G\.(gzip|brotli)$ - [T=text/html,E=no-gzip:1] | |
<FilesMatch "(\.gzip)$"> | |
# Serve correct encoding type. | |
Header set Content-Encoding gzip | |
Header append Vary Accept-Encoding | |
Header unset ETag | |
FileETag None | |
# Shared caches 1 month | |
Header set Cache-Control "public, no-transform, s-maxage=2592000, max-age=0" | |
</FilesMatch> | |
<FilesMatch "(\.brotli)$"> | |
# Serve correct encoding type. | |
Header set Content-Encoding br | |
Header append Vary Accept-Encoding | |
Header unset ETag | |
FileETag None | |
# Shared caches 1 month | |
Header set Cache-Control "public, no-transform, s-maxage=2592000, max-age=0" | |
</FilesMatch> | |
</IfModule> | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment