Update htaccess.

This commit is contained in:
Lars Jung 2016-05-29 14:52:39 +02:00
parent a790c34a24
commit a0db0e0ac3

View file

@ -39,23 +39,19 @@ AddDefaultCharset utf-8
<IfModule mod_mime.c> <IfModule mod_mime.c>
AddCharset utf-8 .css .html .js .json .php .svg AddCharset utf-8 .css .html .js .json .php .svg
AddType application/json json map topojson
AddType application/javascript js
AddType audio/mp4 f4a f4b m4a
AddType audio/ogg oga ogg opus
AddType image/bmp bmp
AddType image/svg+xml svg svgz
AddType image/webp webp
AddType video/mp4 f4v f4p m4v mp4
AddType video/ogg ogv
AddType video/webm webm
AddType video/x-flv flv
AddType image/x-icon cur ico
AddType application/font-woff woff AddType application/font-woff woff
AddType application/font-woff2 woff2 AddType application/font-woff2 woff2
AddType application/json json
AddType application/javascript js
AddType application/vnd.ms-fontobject eot AddType application/vnd.ms-fontobject eot
AddType application/x-font-ttf ttc ttf AddType application/x-font-ttf ttc ttf
AddType image/jpeg jpeg jpg
AddType image/png png
AddType image/svg+xml svg svgz
AddType image/x-icon ico
AddType font/opentype otf AddType font/opentype otf
AddType text/css css
AddType text/html html
</IfModule> </IfModule>
@ -66,8 +62,17 @@ AddDefaultCharset utf-8
ExpiresActive on ExpiresActive on
ExpiresDefault "access plus 1 month" ExpiresDefault "access plus 1 month"
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds" ExpiresByType application/json "access plus 0 seconds"
ExpiresByType text/html "access plus 1 minute"
ExpiresByType image/x-icon "access plus 1 week"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
</IfModule> </IfModule>
<IfModule mod_deflate.c> <IfModule mod_deflate.c>
@ -78,42 +83,83 @@ AddDefaultCharset utf-8
</IfModule> </IfModule>
</IfModule> </IfModule>
<IfModule mod_filter.c> # Apache ≥ 2.3
AddOutputFilterByType DEFLATE "application/atom+xml" \ <IfModule mod_authz_core.c>
"application/javascript" \ # mod_filter as module only available for Apache ≥ 2.3.7
"application/json" \ <IfModule mod_filter.c>
"application/ld+json" \ AddOutputFilterByType DEFLATE "application/atom+xml" \
"application/manifest+json" \ "application/javascript" \
"application/rdf+xml" \ "application/json" \
"application/rss+xml" \ "application/ld+json" \
"application/schema+json" \ "application/manifest+json" \
"application/vnd.geo+json" \ "application/rdf+xml" \
"application/vnd.ms-fontobject" \ "application/rss+xml" \
"application/x-font-ttf" \ "application/schema+json" \
"application/x-javascript" \ "application/vnd.geo+json" \
"application/x-web-app-manifest+json" \ "application/vnd.ms-fontobject" \
"application/xhtml+xml" \ "application/x-font-ttf" \
"application/xml" \ "application/x-javascript" \
"font/eot" \ "application/x-web-app-manifest+json" \
"font/opentype" \ "application/xhtml+xml" \
"image/bmp" \ "application/xml" \
"image/svg+xml" \ "font/eot" \
"image/vnd.microsoft.icon" \ "font/opentype" \
"image/x-icon" \ "image/bmp" \
"text/cache-manifest" \ "image/svg+xml" \
"text/css" \ "image/vnd.microsoft.icon" \
"text/html" \ "image/x-icon" \
"text/javascript" \ "text/cache-manifest" \
"text/plain" \ "text/css" \
"text/vcard" \ "text/html" \
"text/vnd.rim.location.xloc" \ "text/javascript" \
"text/vtt" \ "text/plain" \
"text/x-component" \ "text/vcard" \
"text/x-cross-domain-policy" \ "text/vnd.rim.location.xloc" \
"text/xml" "text/vtt" \
"text/x-component" \
"text/x-cross-domain-policy" \
"text/xml"
</IfModule>
</IfModule>
# Apache < 2.3
<IfModule !mod_authz_core.c>
AddOutputFilterByType DEFLATE "application/atom+xml" \
"application/javascript" \
"application/json" \
"application/ld+json" \
"application/manifest+json" \
"application/rdf+xml" \
"application/rss+xml" \
"application/schema+json" \
"application/vnd.geo+json" \
"application/vnd.ms-fontobject" \
"application/x-font-ttf" \
"application/x-javascript" \
"application/x-web-app-manifest+json" \
"application/xhtml+xml" \
"application/xml" \
"font/eot" \
"font/opentype" \
"image/bmp" \
"image/svg+xml" \
"image/vnd.microsoft.icon" \
"image/x-icon" \
"text/cache-manifest" \
"text/css" \
"text/html" \
"text/javascript" \
"text/plain" \
"text/vcard" \
"text/vnd.rim.location.xloc" \
"text/vtt" \
"text/x-component" \
"text/x-cross-domain-policy" \
"text/xml"
</IfModule> </IfModule>
<IfModule mod_mime.c> <IfModule mod_mime.c>
AddEncoding gzip gz
AddEncoding gzip svgz AddEncoding gzip svgz
</IfModule> </IfModule>
</IfModule> </IfModule>