Leverage browser caching

Google PageSpeed Insights says the next Error/Warning:

Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.

 

[codesyntax lang=”c”]

# Browser Caching

FileETag MTime Size

<IfModule expires_module>
ExpiresActive on
ExpiresByType text/plain "access plus 1 week"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-javascript "access plus 1 week"
ExpiresByType image/svg+xml "access plus 1 week"
ExpiresByType image/gif "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType image/ico "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 week"
ExpiresByType image/jpg "access plus 1 week"
ExpiresByType image/jpe "access plus 1 week"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType font/truetype "access plus 1 week"
ExpiresByType application/x-font-ttf "access plus 1 week"
ExpiresByType font/opentype "access plus 1 week"
ExpiresByType application/x-font-otf "access plus 1 week"
ExpiresByType application/font-woff "access plus 1 week"
ExpiresByType application/vnd.ms-fontobject "access plus 1 week"
ExpiresByType application/x-shockwave-flash "access plus 1 week"
ExpiresByType application/x-httpd-php-source "access plus 1 week"
</IfModule>

[/codesyntax]

 

Senior Web Developer / System Administrator
PHP Consultant at Universidad Autónoma de Nuevo León
http://www.linkedin.com/in/leninmezazarco

Deja un comentario