Vill du få bort varningen ”Leverage browser caching” (utnyttja webbläsarens cache) från hastighetsverktyg som Google PageSpeed Insights? Genom att öka Expire-tiden talar du om för besökarens webbläsare hur länge den får spara filer som bilder, CSS och JavaScript lokalt. Då laddas din sida snabbare vid återbesök.
Du ökar Expire-tiden genom att lägga till följande kod i din .htaccess-fil:
## EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType application/pdf "access plus 1 month" ExpiresByType text/x-javascript "access plus 1 month" ExpiresByType application/x-shockwave-flash "access plus 1 month" ExpiresByType image/x-icon "access plus 1 year" ExpiresDefault "access plus 2 days" </IfModule> ## EXPIRES CACHING ##
