: Google Chrome audit: resources are explicitly non-cacheable? If I run a Google Chrome audit on a site, it lists all CSS, PNG, JPG, JS files and even the main domain (i.e. www.example.com) under
If I run a Google Chrome audit on a site, it lists all CSS, PNG, JPG, JS files and even the main domain (i.e. example.com) under the heading:
Leverage browser caching
The following resources are explicitly non-cacheable. Consider making them cacheable if possible
Will the features in the .htaccess of the HTML5 boilerplate help to resolve this?
If not, how best to approach this?
More posts by @Welton855
1 Comments
Sorted by latest first Latest Oldest Best
Yes that HTML5 Boilerplate link does contain the .htaccess information to make it pass Leverage Browsing caching.
Basiclly to pass that you just to make your images, js, css cacheable. You don't need to use the boilerplate method as theres many othre ways such as using a CDN network with your files using a 2 week TTL setting.
Another snippet of code that will work with Apache looks like
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 86400 seconds"
ExpiresByType application/x-javascript "access plus 86400 seconds"
I recommend images 4 weeks since its not often your change these and 2 weeks for JS and 72 hours for CSS but its down to personally choice.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.