I'm aware that for standard content in an Umbraco site, we have the option of using either Document or Node in C# to access their properties and other data. Document makes a call to the database, while Node uses the cache and so is often much quicker and less resource-hungry.
I've built a media management tool, and while it works great, there's a 2/3-second delay on the initial page load, which is while - I assume - it makes X number of calls to a database to fetch all Media items of a certain type, which at the moment there are ~150 items.
So is there a Node equivalent for Media? Or does Node work for both Media and Documents?
I wonder if any of the uQuery.GetMedia.... methods could help ? internally they each hit the DB once to build an xml representation of all media which is then queried, but for better performance how about caching this media xml in your code via uQuery.GetPublishedXml(uQuery.UmbracoObjectType.Media) ?
Thanks for your response. uQuery does look like the way to go, but unfortunately the project I'm working on is using 4.7.2, and it looks like uQuery was added in 4.8. I can't imagine that this would be enough to pursuade an upgrade, either, sadly. Thanks for the tip, though -- I hadn't come across uQuery before, so will hopefully get a chance to try it out on the next project!
A Media equivalent of Document/Node?
I'm aware that for standard content in an Umbraco site, we have the option of using either Document or Node in C# to access their properties and other data. Document makes a call to the database, while Node uses the cache and so is often much quicker and less resource-hungry.
I've built a media management tool, and while it works great, there's a 2/3-second delay on the initial page load, which is while - I assume - it makes X number of calls to a database to fetch all Media items of a certain type, which at the moment there are ~150 items.
So is there a Node equivalent for Media? Or does Node work for both Media and Documents?
Hi Ed,
I wonder if any of the uQuery.GetMedia.... methods could help ? internally they each hit the DB once to build an xml representation of all media which is then queried, but for better performance how about caching this media xml in your code via uQuery.GetPublishedXml(uQuery.UmbracoObjectType.Media) ?
HTH,
Hendy
Hi Hendy,
Thanks for your response. uQuery does look like the way to go, but unfortunately the project I'm working on is using 4.7.2, and it looks like uQuery was added in 4.8. I can't imagine that this would be enough to pursuade an upgrade, either, sadly. Thanks for the tip, though -- I hadn't come across uQuery before, so will hopefully get a chance to try it out on the next project!
Ed
Hi Ed,
In that case, if you have uComponents installed, then uQuery is in there... (the only difference being its namespace)
Hendy
You could use a DynamicMedia object :)
is working on a reply...