Hey folks,
after a week with importing and re-creating the basic structure to make it more useable, currently I’m trying to optimize some huge queries.
Note: All this changes are made and tested on our development enviroment. I do not take the responsibility for any performance issues you might have, but if you are getting some – post it in the comments and I will try to help you.
First I have improved the Sitecore tracing functionality to each of the sublayouts, to see how long it takes to execute some step. You can do this by adding the following lines to your sublayout:
using Sitecore.Diagnostics;
Profiler.StartOperation(“My Project: Resolving downloads”);
(…)
Tracer.Info(“My Project: Loaded all downloads”);
if(some == null) Tracer.Error(“My Project: Some things gone bad.”);
(… some other steps you want to profile …)
Profiler.EndOperation();
Then you are able to use the Debug mode and see how long your created sublayout take to being rendered, how many items are accessed in this sublayout and also do debug your code by using the “Tracer.Error(“”)”, “Tracer.Fatal(“”)”. This is also written to the logfile.
Here we go. After reading the Article and some browsing around I enabled the Browser cache, by default the browser cache is disabled. And changed the line at my “Master Layout”.
(web.config)
< !– DISABLE BROWSER CACHING
   If true, all pages will have:
   Cache-Control: no-cache, no-store
   Pragma: no-cache
   in the http header
– >
<setting name=”DisableBrowserCaching” value=”false”></setting >
(Master Layout file)
<!–OutputCache Duration=”60″ Location=”Client” VaryByParam=”None”–>
The duration is declared in seconds. After this step I have been gone through the XSLT renderings and enabled caching based on the function the rendering have. You can do this on many several ways. On the template when you are defining the presentation, or what I did in the /sitecore/layout/Renderings/… tree by selecting the item and checked on the boxes you want to use. Here you can see what each checkbox are doing if you enabling this.
I think that are a couple of things you can do in general, now I just optimized some really huge requests by using the Cache[""] object to store some object, like static lists and overviews with more than a couple of hundred items.
I am going to make some load tests with this configuration and keep you updated, but for my “feeling” it’s much more faster.
If somebody has other tips, please write a comment.
Hope that helps some of you. cheers chris
Related Links:
- SDN5 Article about Sitecore performance
- Caching by using C# (in sublayouts)
- SDN5 Article about Caching complete Layouts by using IIS
- Microsoft documentation about the Cache class