Copied to clipboard

Flag this post as spam?

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


  • Barry Fogarty 493 posts 1129 karma points
    Feb 04, 2015 @ 15:43
    Barry Fogarty
    0

    Donut caching error when posting to an action

    Just wondering if you have come accross the following issue when using a Donut caching with a http POST to a controller action:

    NullReferenceException: Object reference not set to an instance of an object.]
       DevTrends.MvcDonutCaching.KeyGenerator.GenerateKey

    I have a cache set on my route-hijacked surface controller for the page, e.g.

    [DonutOutputCache(CacheProfile = "OneDay")]

    and I also have a cache 'hole' defined in my action like so

    @Html.Action("RenderRegistrationForm","Registration", true)

    The above error occurs when I post to my controller action to handle the form, e.g.

    Html.BeginUmbracoForm<RegistrationController>("HandleRegisterMember")

    If I remove the cache attribute on the parent surface controller, it works as expected (but of course then nothing gets cached).  Is this a bug with donutcaching or am I implementing it wrong?  I would have thought any kind of post simply ignores cache altogether.

     

  • TikTakToe 60 posts 102 karma points
    May 16, 2015 @ 08:49
    TikTakToe
    0

    Hi,

    I fixed this by getting the latest version of donut cache - i believe it's a bug that's been fixed in the latest version.

    Cheers

    Ian

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Jul 15, 2015 @ 15:40
    Dave Woestenborghs
    0

    Hey Barry,

    Were you able to solve this. I'm running in to the same issue

    Dave

  • Barry Fogarty 493 posts 1129 karma points
    Jul 28, 2015 @ 15:38
    Barry Fogarty
    0

    Hey Dave, sorry for the delay been away.

    I updated the package to 1.3.1 beta and that solved it for me.

    https://www.nuget.org/packages/MvcDonutCaching/1.3.1-beta1

  • Simon 692 posts 1068 karma points
    Sep 07, 2016 @ 12:16
    Simon
    0

    I have updated through NuGet but nothing works :/

    The .dll file was not updated tough.

Please Sign in or register to post replies

Write your reply to:

Draft