Umbraco 10 - Content Cache not updating
# help-with-umbraco
n
Hi all, I have a really strange issue with a v10.6.1 site. When an editor updates a property on some content nodes (not all), the front end doesn't update. These fields are, based on current experiences, non-multi-lingual but the site in question has a culture bound to the primary root node. The examine index updates and you can see the value change in there, but the front end Umbraco nucache continues to return the old values untill the site is completely restarted (sometimes multiple restarts are needed). It is as if there is a massive caching element happening but cannot find any code that indicates this behaviour. Does anyone have any ideas?
n
Needs more info. What property type, does this happen if you downgrade umbraco version? Are all umbraco context references being disposed?
n
The one I'm currently investigating is a text string. I've not tested it in other versions of Umbraco, but that raises the question of how do you downgrade? I've never successfully been able to do it. I've also not been able to replicate this issue in any other 10.6.1 sites which is partly why I'm so stumped. I've seen no evidence of umbraco context references being left open any where, but how would I check?
n
IUmbracoContextFactory usage
usync export, downgrade packages, new db, usync import.
n
Thanks 🙂 Will investigate further based on that. I'm also going to point a clean v10.6.1 at the db and see if that makes a difference
I thought I'd done that already, but going to do it again in case I missed something
n
sounds good. I'm hoping to update so keen to know
consider adding logging to any notificationhandlers as well that listen for cache updates
n
Okay, so the good news is pointing a clean v10.6.1 site at the DB, the content changes get picked up instantly... now to figure out what wierd caching is going on in this code base
Also, good news I found the issue... Someone had extended a Models Builder model and added a property that looks like this:
Copy code
cs
public LanguageWebsite? LanguageWebsite
{
    get => _languageWebsite ?? (_languageWebsite = this.Ancestor<LanguageWebsite>());
}
Which means that language website was only being gotten once and subsequently got out of data if it was republished.... as it essentially acted like a cache
With the performance of v10, is it even worth trying to store it, or is it best to get it each time?
n
I'd get it each time or map to another type and cache that instead. If LanguageWebsite comes from modelsbuilder, it will hold a reference to a nucache snapshot for the lifetime of the app.
n
That's what I thought, thanks 🙂
It's interesting because this problem didn't exist with the same code in a v7 site, the dev who did the work "just" copied it between the sites and becaues it compiled they never saw the problem
n
Reference is not maintained prior to v8. In v7, it was a copy of the object. Or some other reason.
8 Views