Sitecore for Developers
Speeding up Sitecore Experience Editor
6/5/2018
We all know it's slow! I was working on a client project where it took around 30 seconds to load. The first thing you will want to do is follow Brijesh's blog post. Next, you'll want to follow Mikael Högberg blog post. Although I did this a little different. I turned off the count. You can do this by adding the following code:
using Sitecore;using Sitecore.Configuration;using Sitecore.Data;using Sitecore.Data.Items;using Sitecore.Diagnostics;using Sitecore.ExperienceEditor.Speak.Server;using Sitecore.ExperienceEditor.Speak.Server.Contexts;using Sitecore.ExperienceEditor.Speak.Server.Requests;using Sitecore.ExperienceEditor.Speak.Server.Responses;using Sitecore.Security.Accounts;using System;namespace HI.ExperienceEditor.Requests{ public class MyItemsCountRequest : PipelineProcessorRequest<ItemContext> { public MyItemsCountRequest() { } public override PipelineProcessorResponseValue ProcessRequest() { return new PipelineProcessorResponseValue() { Value = string.Empty }; } }}
Next you'll need to patch this in:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <sitecore.experienceeditor.speak.requests> <request name="ExperienceEditor.MyItems.Count"> <patch:attribute name="type"> HI.ExperienceEditor.Requests.MyItemsCountRequest,HI.ExperienceEditor </patch:attribute> </request> </sitecore.experienceeditor.speak.requests> </sitecore></configuration>
Finally, you'll want to create a patch for Sitecore's Speak.HttpCaching.SetMaxAge setting. By default, Sitecore will set the Max-Age header to 0 for all assets and they won't be cached in Experience Editor. We can speed things up further by adding the following:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <settings> <setting name="Speak.HttpCaching.SetMaxAge"> <patch:attribute name="value">false</patch:attribute> </setting> </settings> </sitecore></configuration>
Hope this helps!