Created
July 16, 2017 06:50
-
-
Save gapple/9dc4456ee43acea9ca861019c73c7443 to your computer and use it in GitHub Desktop.
htaccess gzip/brotli-bomb
This file contains hidden or 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