Created
October 12, 2015 07:36
-
-
Save sanglt/4086dfa2d2bbd52db2af to your computer and use it in GitHub Desktop.
Add patch to .htacces of files + private folder
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
| diff --git a/includes/file.inc b/includes/file.inc | |
| index d209e0a..640e7a7 100644 | |
| --- a/includes/file.inc | |
| +++ b/includes/file.inc | |
| @@ -530,6 +530,61 @@ SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 | |
| <IfModule mod_php5.c> | |
| php_flag engine off | |
| </IfModule> | |
| +# BEGIN Compress text files | |
| +<ifModule mod_deflate.c> | |
| + <filesMatch ".(css|js|x?html?)$"> | |
| + SetOutputFilter DEFLATE | |
| + </filesMatch> | |
| +</ifModule> | |
| +# END Compress text files | |
| + | |
| +# BEGIN Expire headers | |
| +<ifModule mod_expires.c> | |
| + ExpiresActive On | |
| + ExpiresDefault "access plus 1 seconds" | |
| + ExpiresByType image/x-icon "access plus 2592000 seconds" | |
| + ExpiresByType image/jpeg "access plus 2592000 seconds" | |
| + ExpiresByType image/png "access plus 2592000 seconds" | |
| + ExpiresByType image/gif "access plus 2592000 seconds" | |
| + ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds" | |
| + ExpiresByType text/css "access plus 604800 seconds" | |
| + ExpiresByType text/javascript "access plus 216000 seconds" | |
| + ExpiresByType application/javascript "access plus 216000 seconds" | |
| + ExpiresByType application/x-javascript "access plus 216000 seconds" | |
| + ExpiresByType text/html "access plus 600 seconds" | |
| + ExpiresByType application/xhtml+xml "access plus 600 seconds" | |
| +</ifModule> | |
| +# END Expire headers | |
| + | |
| +# BEGIN Cache-Control Headers | |
| +<ifModule mod_headers.c> | |
| + <filesMatch ".(ico|jpe?g|png|gif|swf)$"> | |
| + Header set Cache-Control "max-age=2592000, public" | |
| + </filesMatch> | |
| + <filesMatch ".(css)$"> | |
| + Header set Cache-Control "max-age=604800, public" | |
| + </filesMatch> | |
| + <filesMatch ".(js)$"> | |
| + Header set Cache-Control "max-age=216000, private" | |
| + </filesMatch> | |
| + <filesMatch ".(x?html?|php)$"> | |
| + Header set Cache-Control "max-age=600, private, must-revalidate" | |
| + </filesMatch> | |
| +</ifModule> | |
| +# END Cache-Control Headers | |
| + | |
| +# BEGIN Turn ETags Off | |
| +<ifModule mod_headers.c> | |
| + Header unset ETag | |
| +</ifModule> | |
| +FileETag None | |
| +# END Turn ETags Off | |
| + | |
| +# BEGIN Remove Last-Modified Header | |
| +<ifModule mod_headers.c> | |
| + Header unset Last-Modified | |
| +</ifModule> | |
| +# END Remove Last-Modified Header | |
| EOF; | |
| if ($private) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment