In this article we’d like to give you Sense/Net CMS users a couple advice how to keep your portal fast or make it more responsible to user requests.
We gathered the most common solutions for performance issues we have encountered so far:
- Use NodeObserver with caution
NodeObserver is useful when you want to do something whenever a node is being created or changed but it can also cause a huge performance issue when hundreds or thousands of nodes are being processed.
- Prefer ASCX to XSLT
During XSLT rendering all the related Content will be serialized which can be expensive in some scenarios.
- Organize content into subfolders
If you have large amount of Content in only one folder then you should consider organizing them into subfolders. A good way to accomplish this is using letters or dates as the name of the subfolders. You may also need to make it invisible to users so creating a custom program logic which lists the content in one place as if they were in the same folder would suits your needs.
- Don’t use too much references in a Content
It’s sort of the same as the last one that displaying all the references (or child elements) of a given Content can slower your portal’s response.
- NodeHead against Node
When you want to get only the basic information of a Node consider loading it's NodeHead instead. NodeHead class contains less information about a Node so it doesn't require to load everything belong to the Node itself. Less database operation, faster execution.
- Webservices and cache
If you can then put the result of a call to a webservice to the cache. Next time you won’t need to call it again.
- Use .TOP keyword in Content Queries
Try to minimize the result of your content query. To do so there’s a .TOP keyword you can use.
A common scenario is when “.TOP:26” is specified but only the first 25 content are displayed and the 26th will be used, if exists, to determine if there is another page so that a link can be generated to the next page.
- Avoid “ Path:* “ keyword in Content Queries
Use InTree or InFolder instead. They are much faster.
- .COUNTONLY if enough
Using .COUNTONLY keyword makes the query return with only the number of elements found by the query you specified. It won’t create any LucObjects so use it wherever you need only the size of the result.
By following these considerations will help you solve performance issues related to loading Nodes / Content.
We also highly recommend to follow the general .NET and ASP.NET performance practices. There are a lot of articles about it out there.
Read more about Content Queries in Sense/Net 6.0 Wiki!
Please feel free to ask any questions about Sense/Net performance in our Forum!