.htaccess mods for better site speed

#Enable Gzip <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> #Compress SVG not supported by apahe AddType image/svg+xml .svg AddOutputFilterByType DEFLATE image/svg+xml # 1 Month for most static assets <filesMatch ".(css|jpg|jpeg|png|gif|js|ico|svg)$"> Header set Cache-Control "max-age=2592000, public" </filesMatch>
First group sets Gzip compression
Second sets SVG compression
Third sets expiration date for specific files

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.