This works, but performance isn't quite good, and I actually only have a few hundred items in the Media library. The query needs about 10 seconds. Caching is a way to optimize, but the first call keeps slow.
Internally that method hits the database and builds an Xml doc from the rows of media items in cmsContentXml (there isn't an in memory xml doc of media), but perhaps, as you say, caching the media Xml might help ?
I wonder how this can be added internally to uComponents - perhaps the addition of an event handler that on save of any Media causes that cache to be wiped ?
Get Media by type (4.7.1)
Hi,
I'm trying to recursively get all media items of a specific (custom) media type, starting from a defined node:
List<Media> galleries = uQuery.GetMediaByXPath("descendant::*[@id='"+startNode+"']/descendant::*[@nodeTypeAlias='ImageGalleries']");
This works, but performance isn't quite good, and I actually only have a few hundred items in the Media library. The query needs about 10 seconds. Caching is a way to optimize, but the first call keeps slow.
Any idea/alternatives to my approach?
Best Regards
Andreas
Hi Andreas,
Internally that method hits the database and builds an Xml doc from the rows of media items in cmsContentXml (there isn't an in memory xml doc of media), but perhaps, as you say, caching the media Xml might help ?
I wonder how this can be added internally to uComponents - perhaps the addition of an event handler that on save of any Media causes that cache to be wiped ?
HTH,
Hendy
is working on a reply...