Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <IfModule mod_deflate.c>
- # Insert filter
- SetOutputFilter DEFLATE
- # 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 to get the desired effect:
- BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
- # Don't compress images
- SetEnvIfNoCase Request_URI \
- \.(?:gif|jpe?g|png)$ no-gzip dont-vary
- # Make sure proxies don't deliver the wrong content
- Header append Vary User-Agent env=!dont-vary
- </IfModule>
- <ifModule mod_gzip.c>
- mod_gzip_on Yes
- mod_gzip_dechunk Yes
- mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
- mod_gzip_item_include handler ^cgi-script$
- mod_gzip_item_include mime ^text/.*
- mod_gzip_item_include mime ^application/x-javascript.*
- mod_gzip_item_exclude mime ^image/.*
- mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
- </ifModule>
- <ifModule mod_expires.c>
- ExpiresActive On
- ExpiresDefault "access plus 1 seconds"
- ExpiresByType text/html "access plus 1 seconds"
- ExpiresByType image/gif "access plus 2592000 seconds"
- ExpiresByType image/jpeg "access plus 2592000 seconds"
- ExpiresByType image/png "access plus 2592000 seconds"
- ExpiresByType text/css "access plus 604800 seconds"
- ExpiresByType text/javascript "access plus 216000 seconds"
- ExpiresByType application/x-javascript "access plus 216000 seconds"
- </ifModule>
- <ifModule mod_headers.c>
- <filesMatch "\\.(ico|pdf|flv|jpg|jpeg|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 "\\.(xml|txt)$">
- Header set Cache-Control "max-age=216000, public, must-revalidate"
- </filesMatch>
- <filesMatch "\\.(html|htm|php)$">
- Header set Cache-Control "max-age=1, private, must-revalidate"
- </filesMatch>
- </ifModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement