diff --git a/.htaccess b/.htaccess index f1ef8719ba1a8421e3d58aeceee851da731e4f77..9d55781c37765187e53b0295891d6a57c2d66756 100644 --- a/.htaccess +++ b/.htaccess @@ -166,7 +166,53 @@ ## Add default Expires header ## http://developer.yahoo.com/performance/rules.html#expires - ExpiresDefault "access plus 1 year" + <FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|ttf|otf|woff|woff2|ogg|mp4|webm)$> + Header append Cache-Control private + </FilesMatch> + + ExpiresActive On + + <FilesMatch \.(html|xhtml|xml|shtml|phtml|php|txt)$> + ExpiresDefault "access plus 0 seconds" + </FilesMatch> + + ExpiresByType text/html "access plus 0 seconds" + + # Data + ExpiresByType text/xml "access plus 0 seconds" + ExpiresByType application/xml "access plus 0 seconds" + ExpiresByType application/json "access plus 0 seconds" + + # MFavicon, images, video, audio + <FilesMatch \.(ico|gif|png|jpg|jpeg|ogg|mp4|mkv|flv|swf|wmv|asf|asx|wma|wax|wmx|wm)$> + ExpiresDefault "access plus 1 year" + </FilesMatch> + ExpiresByType image/gif "access plus 1 year" + ExpiresByType image/png "access plus 1 year" + ExpiresByType image/jpg "access plus 1 year" + ExpiresByType image/jpeg "access plus 1 year" + ExpiresByType image/svg "access plus 1 year" + ExpiresByType video/ogg "access plus 1 year" + ExpiresByType audio/ogg "access plus 1 year" + ExpiresByType video/mp4 "access plus 1 year" + ExpiresByType video/webm "access plus 1 year" + + # Fonts + <FilesMatch \.(eot|ttf|otf|svg|woff|woff2)$> + ExpiresDefault "access plus 1 year" + </FilesMatch> + ExpiresByType application/x-font-ttf "access plus 1 year" + ExpiresByType font/opentype "access plus 1 year" + ExpiresByType application/x-font-woff "access plus 1 year" + ExpiresByType image/svg+xml "access plus 1 year" + ExpiresByType application/vnd.ms-fontobject "access plus 1 year" + + # CSS, JavaScript + <FilesMatch \.(css|js)$> + ExpiresDefault "access plus 1 year" + </FilesMatch> + ExpiresByType text/css "access plus 1 year" + ExpiresByType application/javascript "access plus 1 year" </IfModule> @@ -188,3 +234,4 @@ ## http://developer.yahoo.com/performance/rules.html#etags #FileETag none + #FileETag MTime Size