When getting content from Umbraco which approach is better for performance? Currently everything works fine, but I am considering situation after 1-5 years when after amount of content increases(which is going to be huge).
Would it be better in terms of performance to search content and content type using XMLPath?
What are performance considerations and best practices in Umbraco?
Are you getting content for backoffice purposes? If so, there's no issue in using contentService and contentTypeService
Or are you using these services to fetch umbraco content to display in your templates? If that's the case, hold your horses, as you shouldn't be using the aforementioned services.
Performance considerations of getting content
Hello,
When getting content from Umbraco which approach is better for performance? Currently everything works fine, but I am considering situation after 1-5 years when after amount of content increases(which is going to be huge).
Currently I am using following methods
contentService.GetContentOfContentType
contentTypeService.GetContentType(contentTypeAlias)
Would it be better in terms of performance to search content and content type using XMLPath? What are performance considerations and best practices in Umbraco?
Please share your consideration.
Hi Aman,
Depends....
Are you getting content for backoffice purposes? If so, there's no issue in using contentService and contentTypeService
Or are you using these services to fetch umbraco content to display in your templates? If that's the case, hold your horses, as you shouldn't be using the aforementioned services.
Fetching umbraco content is done differently, see https://our.umbraco.org/documentation/Reference/Querying/ for more information
And this link is also useful: https://our.umbraco.org/documentation/Reference/Common-Pitfalls/
Cheers,
--Dirk
Thank you Dirk!
is working on a reply...