Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Dan 1285 posts 3917 karma points c-trib
    Oct 14, 2013 @ 12:49

    How to leverage browser caching


    I've run a client site through the Google Developer Page Speed tools ( 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?

    Thanks folks!

  • Dan 1285 posts 3917 karma points c-trib
    Nov 15, 2013 @ 22:10

    Just to wrap this up for reference, the solution was to add a line to the web.config file, inside

      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="2.00:00:00" />

    It's documented here: 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.)

  • Craig Cronin 304 posts 503 karma points
    Aug 15, 2015 @ 22:51
    Craig Cronin

    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 :)

  • Johan Plesner Hamann 105 posts 199 karma points
    Feb 26, 2016 @ 22:58
    Johan Plesner Hamann

    Does not work for me. It write this in Google PageSpeed (udløbsdato er ikke specificeret)

    Is there anything else I can do?

    On Umbraco v6.1.6


  • Md Ashraf Malik 1 post 20 karma points
    Aug 03, 2016 @ 16:58
    Md Ashraf Malik

    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.

    <clientCache cacheControlMode="UseExpires" httpExpires="Tue,19 Jan 2038 03:14:07 GMT"/>


Please Sign in or register to post replies

Write your reply to: