Copied to clipboard

Flag this post as spam?

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


  • Tejasree Konduru 6 posts 76 karma points
    May 22, 2024 @ 10:26
    Tejasree Konduru
    0

    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.

  • Bo Jacobsen 606 posts 2404 karma points
    May 22, 2024 @ 12:27
    Bo Jacobsen
    0

    Hi Tejasree.

    Does your partial view contain any form that uses the antiforgerytoken? Because then it won't be cached by default.

  • Tejasree Konduru 6 posts 76 karma points
    May 22, 2024 @ 15:27
    Tejasree Konduru
    0

    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.

  • Bo Jacobsen 606 posts 2404 karma points
    May 23, 2024 @ 08:25
    Bo Jacobsen
    0
Please Sign in or register to post replies

Write your reply to:

Draft