Copied to clipboard

Flag this post as spam?

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


  • Ihor 2 posts 71 karma points
    Mar 11, 2024 @ 18:12
    Ihor
    0

    Issue with returning CurrentUmbracoPage and ERR_CACHE_MISS

    Hi all I have an issue with returning CurrentUmbracoPage when the model is invalid. So, let me describe how I recreate this issue

    • Go to page with form, enter wrong data
    • ModelState is invalid, so I return CurrentUmbracoPage()
    • Enter right data, get redirected to next page with RedirectToUmbracoPage
    • Press back
    • Get ERRCACHEMISS error

    If I enter right data the first time, then I do not have this issue. So I think CurrentUmbracoPage is causing the issue.

    I did some research on this, so here is what I found

    On old Umbraco 7 I could not recreate this, and I think this is why:

    In old Umbraco 7(.NET Framework) Cache-Control for the pages are set to private, but in .NET Core, it's set to no-cache, no-store. And in old Umbraco, when I press back, I can see that the page is returned with 200 OK (from disk cache)

    Also when I use return CurrentUmbracoPage, it returns the page, but the request for this becomes POST, when originally it was GET. So without cached request, it makes sense that ERRCACHEMISS pops up.

    And also, I tried to use RedirectToCurrentUmbracoPage, and it fixed the problem, but introduces the issue that ModelState is not saved, and saving it in somewhere else seems wrong.

    Anyway, I do not know how to proceed further. Please let me know if you need additional info.

Please Sign in or register to post replies

Write your reply to:

Draft