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.
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.
is working on a reply...