The LazyFields in LocalizationPart are "backed" by information in the LocalizationPartRecord. In the Loader and Setter for those LazyFields we are currently referring directly to properties of the Record.
|
protected static void PropertySetHandlers(ActivatedContentContext context, LocalizationPart localizationPart) { |
As a consequence, whenever there is a
ContentItem that has a
LocalizationPart and we need to access one of those properties, a query has to be performed. This happens often when displaying multi-language websites that rely on localized content and widgets: we easily end up having 10+ queries for that to visualize a simple page.
It seems trivial to use Store/Retrieve methods in the Loader and Setter for those LazyFields.
I have a PR coming soon for this. I've tested it a little, and it seems to work for all cases I've put it through, but localization is a complex topic so I'm not yet 100% sure I've covered all corner cases.
The
LazyFields inLocalizationPartare "backed" by information in theLocalizationPartRecord. In theLoaderandSetterfor thoseLazyFields we are currently referring directly to properties of the Record.Orchard/src/Orchard.Web/Modules/Orchard.Localization/Handlers/LocalizationPartHandler.cs
Line 32 in 610b3c4
As a consequence, whenever there is a
ContentItemthat has aLocalizationPartand we need to access one of those properties, a query has to be performed. This happens often when displaying multi-language websites that rely on localized content and widgets: we easily end up having 10+ queries for that to visualize a simple page.It seems trivial to use
Store/Retrievemethods in theLoaderandSetterfor thoseLazyFields.I have a PR coming soon for this. I've tested it a little, and it seems to work for all cases I've put it through, but localization is a complex topic so I'm not yet 100% sure I've covered all corner cases.