Copied to clipboard

Flag this post as spam?

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


  • Asger 25 posts 171 karma points
    Jul 27, 2016 @ 10:16
    Asger
    0

    Leverage browser caching (best practice)

    Hi.

    I recently switched to umbraco as my cms system. I am really happy with everything, and my pagespeed is awesome.

    The only issue i have is with the browser caching.

    I have looked at tons of forum and google searches that said conflicting things, so now i ask you.

    What would be the best way to leverage browser caching (in regards to pagespeed optimization)

    Thanks in advance.

    Best regards.

  • Cristhian Amaya 52 posts 423 karma points
    Jul 27, 2016 @ 10:53
    Cristhian Amaya
    100

    Hey Asger,

    You only need to add the following lines to your web.config:

    <staticContent>
      <clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
    </staticContent>
    

    I'd also highly recommend you to have a look to https://github.com/h5bp/server-configs-iis/tree/master/doc. You can find really useful settings tweaks there and, very important, the explanation about what they do.

    Cheers!

  • Asger 25 posts 171 karma points
    Jul 27, 2016 @ 11:13
    Asger
    0

    Hi.

    That link looks very usefull, i will read trough it right away. thanks :)

    I added the code to my web.config file, but somehow it just crashed.. How can that be? does it have to be in a specific part of the file?

    Best regards.

  • Asger 25 posts 171 karma points
    Jul 27, 2016 @ 11:23
    Asger
    0

    It apears that my mistake is a missing section decleration in the webconfig file. How do i know what the section decleration should be?

  • Cristhian Amaya 52 posts 423 karma points
    Jul 27, 2016 @ 12:03
Please Sign in or register to post replies

Write your reply to:

Draft