I might be missing something, but CachedPartial isn't playing well with multiple languages in Umbraco V8. Is there any additional key I need to set up if I:
if (contextualKeyBuilder != null)
{
var contextualKey = contextualKeyBuilder(model, viewData);
cacheKey.AppendFormat("c{0}-", contextualKey);
}
It seems the multilanguage behavior is not supported by default when you have a look at the implementation of CachedPartial(), so you can try to implement your own contextualKeyBuilder:
CachedPartial with V8
I might be missing something, but CachedPartial isn't playing well with multiple languages in Umbraco V8. Is there any additional key I need to set up if I:
a) don't want cachedpartial to be cached by page
b) I want it to be cached by language
This doesn't work (it displays wrong language):
@Html.CachedPartial("FooPartial", Model, 14400)
Hi Zoki,
Maybe you can try this. When you have a look at the implementation of the
CachedPartial()
method on https://github.com/umbraco/Umbraco-CMS/blob/853087a75044b814df458457dc9a1f778cc89749/src/Umbraco.Web/HtmlHelperRenderExtensions.cs you will see this part of code:It seems the multilanguage behavior is not supported by default when you have a look at the implementation of
CachedPartial()
, so you can try to implement your own contextualKeyBuilder:I'm curious if this will work, please let me know.
It appears to be working well Corne :)
I could really have tried that myself and not bother you, I was only expecting that CachedPartial method was extended for new language system.
But I'm ok with this solution too.
Thanks!
is working on a reply...