I've run a client site through the Google Developer Page Speed tools (https://developers.google.com/speed/pagespeed/). One of the suggestions this yields is to "Leverage browser caching". It describes this as:
"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."
I thought browsers cached resources such as CSS files and images by default, without having to set IIS to do this specifically, but perhaps IIS does need to be configured to do this and this new server just hasn't been fully set up?
Anyhow, I can probably find out how to do this in IIS7, but my question is what implications this may have on a general Umbraco site? Are there things in the back-office that shouldn't be cached client-side or am I okay just to go ahead and set a blanket client-side cache?
Can anyone shed any light on this? Suggestions/recommendations as to the best way to do it? What do others do in this scenario?
EDIT: The only gotcha I had with this is that it doesn't work for images generated by CropUp. In this case you just need to remove the CropUp clean URL handler from web.config: <add name="CropUpUrls" type="Eksponent.CropUp.Plugins.CleanUrls" /> (Props to Jeavon for this.)
How to leverage browser caching
Hi,
I've run a client site through the Google Developer Page Speed tools (https://developers.google.com/speed/pagespeed/). One of the suggestions this yields is to "Leverage browser caching". It describes this as:
I thought browsers cached resources such as CSS files and images by default, without having to set IIS to do this specifically, but perhaps IIS does need to be configured to do this and this new server just hasn't been fully set up?
Anyhow, I can probably find out how to do this in IIS7, but my question is what implications this may have on a general Umbraco site? Are there things in the back-office that shouldn't be cached client-side or am I okay just to go ahead and set a blanket client-side cache?
Can anyone shed any light on this? Suggestions/recommendations as to the best way to do it? What do others do in this scenario?
Thanks folks!
Just to wrap this up for reference, the solution was to add a line to the web.config file, inside
It's documented here: http://www.iis.net/configreference/system.webserver/staticcontent/clientcache and as far as I know has no negative implications for the general running of umbraco at all.
EDIT: The only gotcha I had with this is that it doesn't work for images generated by CropUp. In this case you just need to remove the CropUp clean URL handler from web.config:
<add name="CropUpUrls" type="Eksponent.CropUp.Plugins.CleanUrls" />
(Props to Jeavon for this.)Just had the same issue from a client. Seo company have sent the exact message and came across your post dan.
Thanks for posting a solution to your own problem :)
Does not work for me. It write this in Google PageSpeed
Is there anything else I can do?
On Umbraco v6.1.6
~Johan
To enable leverage browser caching in IIS you just have to follow these steps:
1) Open your hosting panel.
2) Open web.config file.
3) Add cacheControlMode given bellow.
4) Finally save you web.config file and check for caching.
Source
is working on a reply...