Its a case of a little bit of information is a dangerous thing. I run speed test on the site and i always get issues with compression gzip. So well i play around, and then i forget or go back in a couple of months and do it again.
I have watch Joe Workman’s great podcasts on .htaccess but at this point i think i am in over my head as i have added to much and i am worried about deleting - i know i have double code in there.
Could someone have a quick look for me?
This is the full .htaccess file:
Header append Vary User-Agent env=!dont-vary AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json # DEFLATE by extension AddOutputFilter DEFLATE js css htm html xmlDisable Directory Access
Options -Indexes
Expire times for caching
ExpiresActive on
ExpiresDefault "access plus 1 month"
CSS
ExpiresByType text/css "access plus 1 year"
Data interchange
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
Favicon (cannot be renamed!) and cursor images
ExpiresByType image/x-icon "access plus 1 week"
HTML components (HTCs)
ExpiresByType text/x-component "access plus 1 month"
HTML
ExpiresByType text/html "access plus 0 seconds"
JavaScript
ExpiresByType application/javascript "access plus 1 year"
Manifest files
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
ExpiresByType text/cache-manifest "access plus 0 seconds"
Media
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
Web feeds
ExpiresByType application/atom+xml "access plus 1 hour"
ExpiresByType application/rss+xml "access plus 1 hour"
Web fonts
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript \
application/json \
application/rss+xml \
application/vnd.ms-fontobject \
application/x-font-ttf \
application/x-web-app-manifest+json \
application/xhtml+xml \
application/xml \
font/opentype \
image/svg+xml \
image/x-icon \
text/css \
text/html \
text/plain \
text/x-component \
text/xml
</IfModule>
BEGIN GZIP
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript ## END GZIP ## Header append Vary: Accept-EncodingCompression with gzip
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.*secure htaccess file
<Files .htaccess>
order allow,deny
deny from all