-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow caching and prepopulation for isLocalisedInStage #467
Comments
One small challenge with this is that there's no extension hook for prepopulating more items. CMSMain may need an |
Quickly noting that extensions are singletons in SS4 by default, so we'd need to include DataObject IDs and class names in internal cache field names |
Yes that sounds about right @robbieaverill. I'd agree with such a cache addition. We could have FluentSiteTree::prepopulate_localised_cache() as well. |
I'm working on a patch for this now. |
I've noted in silverstripe/silverstripe-framework#8391 a refactoring of these caches to make it easier for modules such as fluent to plug into the system. |
I've been working on this today. It's going okay but pre-populating the cache is a little intense due to the fact that not all pages will be checked, but we can't really know what IDs to filter by on pre-pop. Anyway. I'm addressing this with some |
Just get the results for all pages. If it's an optimised query it'll be a few ms even with 100,000 pages |
Getting the results is pretty quick. Looping the results is not so quick :( - Anyway. It reduces the number of queries by ~200 (for a full site tree), but doesn't really show any significant performance difference on local. I'm guessing the difference will be more measurable on SSP due to 200 less queries. |
Actually I didn't realise the incredible performance improvement of |
Yep! |
Oh I thought it was merged! Ha. |
I've pushed some tests to #468, I think it's good to go |
PR merged |
FluentVersionedExtension::isLocalisedInStage()
is heavily used in the CMS, e.g. when rendering tree items.In order to cut down on the query count on large sites, this value should be able to be cached and the cache prepopulated, as we do for page versions, and as I have recommended for Hierarchy::numChildren() in silverstripe/silverstripe-framework#8379.
The text was updated successfully, but these errors were encountered: