Browser Caching und gzip-Komprimierung auf Webspace

Posted in Apache, 25.10.2013 13:10

Wenn man nicht direkt Zugriff auf die Apache2.conf oder die httpd.conf hat, kann man mittels .htaccess trotzdem wichtige Performance-Einstellungen vornehmen (falls die .htaccess ausgelesen wird , Override All etc. , was aber bei den meisten Providern inzwischen der Fall ist).

 

ExpiresActive On
ExpiresDefault "access plus 1 month"
ExpiresByType application/javascript A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/javascript A2592000
ExpiresByType text/html M604800
ExpiresByType text/xml M604800
ExpiresByType text/css A2592000
ExpiresByType text/plain M604800
ExpiresByType image/gif A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/png A2592000
ExpiresByType image/bmp A2592000


<IfModule mod_deflate.c>


AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript \
application/x-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/javascript \
text/html \
text/plain \
text/x-component \
text/xml

</IfModule>