Copied to clipboard

Flag this post as spam?

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


  • Mario Lopez 168 posts 958 karma points MVP 4x c-trib
    Jan 05, 2021 @ 00:00
    Mario Lopez
    0

    Cache doesn't update on load-balanced environment

    We have a site using load balancing so we have master and public apps. We have a custom importer that reads an external XML file and creates pages with the info in that file. The importer runs as a Hangfire job.

    The problem is that sometimes, yes sometimes :( , the pages are properly saved and display correctly in the master site but not in the public one. If we re-save the page then the changes are updated correctly.

    I guess it's something to do with the missing Umbraco context because the job doesn't run in an HttpContext. When we first implemented the solution, we were using the EnsureUmbracoContext technique but it failed sometimes. As an ugly workaround, we created an API endpoint that is called by a job in Hangfire, this way we are using a real HttpContext but this is the current way and it still keeps failing randomly.

    Any ideas? Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft