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 the heading:Leverage browser cachingThe following resources are explicitly non-cacheable. Consider making them cacheable if possibleWill the features in the .htaccess of the HTML5 boilerplate help to resolve this?If not, how best to approach this?
Google Chrome audit: resources are explicitly non-cacheable?
htaccess;cache;http headers;google chrome;resources
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 likeExpiresActive OnExpiresDefault access plus 1 secondsExpiresByType text/html access plus 1 secondsExpiresByType image/x-icon access plus 2592000 secondsExpiresByType image/gif access plus 2592000 secondsExpiresByType image/jpeg access plus 2592000 secondsExpiresByType image/png access plus 2592000 secondsExpiresByType text/css access plus 604800 secondsExpiresByType text/javascript access plus 86400 secondsExpiresByType application/x-javascript access plus 86400 secondsI 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.