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).
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.
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.
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
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
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?
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).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.
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.Should be fixed with this: http://issues.umbraco.org/issue/U4-8938
Great to hear! Thanks for your help
Thanks again, and happy upgrading!
Release is out now: https://our.umbraco.org/contribute/releases/753/
is working on a reply...