Increasing Website speed: browser caching

Hi! I am using Foundry (and love it!) with RW 7 and was checking my PageSpeed Insights (PageSpeed Insights) which is recommending “Leverage browser caching”. Does anyone have a suggestion on how to do within RW or Foundry?

I am not keen to alter published files, as I will have to do it on every publication, but if it’s the only way, I’d entertain it :slight_smile:

Thanks!

Depending on your hosting plan this is usually done in the .htaccess file in the root directory.
For example in my .htaccess:

<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 5 minutes"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType text/html "access plus 4 hours"
ExpiresByType text/htm "access plus 4 hours"
ExpiresByType text/javascript "access plus 7 days"
ExpiresByType text/css "access plus 7 days"
ExpiresByType text/xml "access plus 7 days"
ExpiresByType application/x-javascript "access plus 7 days"
ExpiresByType application/javascript "access plus 7 days"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType text/cache-manifest "access plus 0 seconds"
</IfModule>
2 Likes