Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <IfModule mod_expires.c>
- ExpiresActive On
- ExpiresDefault "access plus 1 seconds"
- ExpiresByType text/html "access plus 1 seconds"
- ExpiresByType image/gif "access plus 120 minutes"
- ExpiresByType image/jpeg "access plus 120 minutes"
- ExpiresByType image/png "access plus 120 minutes"
- ExpiresByType text/css "access plus 60 minutes"
- ExpiresByType text/javascript "access plus 60 minutes"
- ExpiresByType application/x-javascript "access plus 60 minutes"
- ExpiresByType text/xml "access plus 60 minutes"
- </IfModule>
- # These will enable GZIP compress for everything or all files served by Apache, exclude several file types stated at 'SetEnvIfNoCase'
- <IfModule mod_deflate.c>
- SetOutputFilter DEFLATE
- <IfModule mod_setenvif.c>
- # Netscape 4.x has some problems
- BrowserMatch ^Mozilla/4 gzip-only-text/html
- # Netscape 4.06-4.08 have some more problems
- BrowserMatch ^Mozilla/4\.0[678] no-gzip
- # MSIE masquerades as Netscape, but it is fine
- BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
- # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48, the above regex won’t work. You can use the following
- # workaround (comment the above line and uncomment the below line) to get the desired effect:
- # BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
- # Don’t compress already-compressed files
- SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
- SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
- SetEnvIfNoCase Request_URI .(?:avi|mov|mp3|mp4|rm|flv|swf|mp?g)$ no-gzip dont-vary
- SetEnvIfNoCase Request_URI .pdf$ no-gzip dont-vary
- SetEnvIfNoCase Request_URI \.doc$ no-gzip dont-vary
- </IfModule>
- <IfModule mod_headers.c>
- # Make sure proxies don’t deliver the wrong content
- Header append Vary User-Agent env=!dont-vary
- </IfModule>
- </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement