Copied to clipboard

Flag this post as spam?

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


  • Tim van Rooijen 14 posts 45 karma points
    Sep 01, 2016 @ 13:43
    Tim van Rooijen
    0

    Output cache in umbraco 7.5.2

    Hi

    Upgrated to the latest versions of Umbraco and having some issues with outputcaching.

    When i add the following code to a clean install of Umbraco [OutputCache(Duration = 200)] public ActionResult Home(RenderModel model)

    The following cache header is returned: Cache-Control:private, max-age=200

    When i do the do same thing to a clean 7.4.3 installation it returns this: Cache-Control:public, max-age=200

    Is there something changed here or am i missing something?

    Kind regards Tim

  • Sebastiaan Janssen 5044 posts 15475 karma points MVP admin hq
    Sep 01, 2016 @ 17:35
    Sebastiaan Janssen
    0

    Interesting.. It has to be this part of this commit: https://github.com/umbraco/Umbraco-CMS/commit/b9fcda8f395745de037fb386eec47f7dbb13e14c#diff-599e1880e37afaff82afd5ef114444c3R593

    That's the only place we set this to private. The strange thing is, previously we didn't set a default for this.. so as far as I could tell this should have been private by default all along according to this: https://msdn.microsoft.com/en-us/library/system.web.httpcacheability(v=vs.110).aspx

  • Tim van Rooijen 14 posts 45 karma points
    Sep 01, 2016 @ 20:13
    Tim van Rooijen
    0

    Hi Sebastiaan,

    Thanks for you're reply!

    Could you explain why it should be private?

    Wan't to use a reverse proxy server so i need the public cache headers.

    When you add the same code to the default mvc project you get a public cache header. So why not stay inline with that?

  • Sebastiaan Janssen 5044 posts 15475 karma points MVP admin hq
    Sep 02, 2016 @ 11:37
    Sebastiaan Janssen
    0

    I'm looking into it now. We want to add private I think for the 301 handler so it doesn't get cached. We want to make sure that if an editor changes a URL from /test/ to /test2/ and then changes his mind to change it back to /test/ that browsers get a new redirect and don't cache the old one (ending up at /test2/ which doesn't exist any more).

  • Tim van Rooijen 14 posts 45 karma points
    Sep 02, 2016 @ 11:58
    Tim van Rooijen
    0

    oke thank you. Currently not using the redirect module. Would be nice to have this only when the redirect module is enabled. Think that in asp.net mvc the cache header is changed be the location tag in the outputcache attribute.

  • Sebastiaan Janssen 5044 posts 15475 karma points MVP admin hq
    Sep 02, 2016 @ 13:26
    Sebastiaan Janssen
    0

    Thanks for the feedback!

    Yes, I agree, obviously we shouldn't overrule default behavior. I think I found the fix and it should only overrule the default behavior when the url tracker is enabled AND you're being redirected. The page you're redirected to, if it has an OutputCache attribute should then return 'Cache-Control:public' again. Currently testing that everything works as it should with these new changes I'm making.

  • Sebastiaan Janssen 5044 posts 15475 karma points MVP admin hq
    Sep 03, 2016 @ 08:28
    Sebastiaan Janssen
    100

    Should be fixed with this: http://issues.umbraco.org/issue/U4-8938

  • Tim van Rooijen 14 posts 45 karma points
    Sep 05, 2016 @ 06:27
    Tim van Rooijen
    0

    Great to hear! Thanks for your help

  • Sebastiaan Janssen 5044 posts 15475 karma points MVP admin hq
    Sep 05, 2016 @ 15:02
    Sebastiaan Janssen
    0

    Thanks again, and happy upgrading!

    Release is out now: https://our.umbraco.org/contribute/releases/753/

Please Sign in or register to post replies

Write your reply to:

Draft