Thanks for responding. I have looked at the partial code and don't see any forms being used nor any antiforgerytokens. What I did is that I cleared my existing code replacing with simple html content and the partialview gets cached but when I place my code back it doesn't.
There are few helper/controller calls done from the partialview will that be an issue?
Caching not working in Umbraco 10
Hi there,
I am trying to cache one of the partial in Umbraco and it doesn't seems like working. I have followed the below steps.
1)Set the 'Debug' mode to 'False' in appsettings.json file.
2)And in my layout file I have written the below syntax to cache my partial for 60minutes.
@await Html.CachedPartialAsync("/Views/Partials/_Mypartialname", Model, TimeSpan.FromHours(1),true)
I have also tried various ways to clear the browser cache, Application restart but no luck
Can somebody help me with this please..
Thanks, Tejasree.
Hi Tejasree.
Does your partial view contain any form that uses the antiforgerytoken? Because then it won't be cached by default.
Hi Jacob,
Thanks for responding. I have looked at the partial code and don't see any forms being used nor any antiforgerytokens. What I did is that I cleared my existing code replacing with simple html content and the partialview gets cached but when I place my code back it doesn't.
There are few helper/controller calls done from the partialview will that be an issue?
TIA.
I actuelly do not know.
What if you use the ResponseCache attribute on your controller or the method you use, would that help?
https://docs.umbraco.com/umbraco-cms/v/10.latest-lts/reference/response-caching
https://learn.microsoft.com/en-us/aspnet/core/performance/caching/response?view=aspnetcore-6.0#responsecache-attribute
is working on a reply...