6

I am trying to increase the performance of Experience Editor and one of the slowest calls is to get the number of locked items. It used to be possible to disabled this in older versions of Sitecore (http://sitecoreblog.alexshyba.com/hidden_gem_of_sitecore_page_editor/) however this doesn't work in newer versions.

However Sitecore have released a fix for this for newer versions of Sitecore: https://kb.sitecore.net/en/Articles/2015/12/04/14/31/549951.aspx

I applied the support fix and re-built my master index but the call to get the MyItems Count still takes around 2 seconds (more on Production).

Therefore I applied a similar fix to this to patch my own pipeline to get the count: https://mikael.com/2015/12/speading-up-the-sitecore-experience-editor/.

This is much quicker (5 microseconds!) but I don't understand why the support fix doesn't address this.

Am I doing something wrong? as we are on Sitecore 8.1 update 2 so adding the Sitecore.Support.419438 dll and patch config should have solved it according to the article.

1
  • Just to be sure, you've placed both config and dll files in the right place? Sitecore.Support.419438 from step 1 & 2 and Sitecore.Support.131964 from step 3
    – Koen Heye
    Commented Feb 16, 2017 at 18:24

2 Answers 2

4

This is a little bit old but for people passing through that are seeing the same issues, there is an easier way.

I haven't checked every release however Sitecore 8.1+ (including 9, probably 8 too) comes with setting that is 'true' by default, when this setting is set to 'false' it will essentially disabled this feature by returning 0 like the suggested answer above does.

The setting name is: WebEdit.ShowNumberOfLockedItemsOnButton

Hope this helps someone!

Update

Sitecore 9 returns an empty string not 0 as previously mentioned:

Extracted from Sitecore.ExperienceEditor.Speak.Ribbon.dll

if (!Settings.WebEdit.ShowNumberOfLockedItemsOnButton)
{
    return new PipelineProcessorResponseValue
    {
        Value = string.Empty
    };
}
3
  • Thanks Dru, one issue I saw with the out of the box options is the pipeline still the executes the query to Solr so was still slower than me handling this myself. Is this not the case in this code? Commented Nov 2, 2018 at 13:25
  • Hey Adam, good question. I have just looked at the code in both 8.1 and 9.1, I can confirm that setting gets evaluated and the method returns just before any SOLR query is run, interestingly in 8.1 it doesn't use the Sitecore ContentSearch it actually uses fast query.
    – dru_ward
    Commented Nov 2, 2018 at 13:31
  • Worth mentioning that I was looking at Sitecore 8.1 Update 1 (rev 151207), update 2 and 3 might well have used the content search.
    – dru_ward
    Commented Nov 2, 2018 at 13:35
3

This turned out to be a problem with the 131964 patch file not copying across correctly. Thanks to Koen for making me take another look.

However although the MyItem count takes less than a second now it wasn't as quick as my pipeline as it still executes the query to Solr. Therefore I may just keep my pipeline to keep performance as fast as possible. I've included the code below in case it's useful for anyone else.

Add a pipeline like so:

using Sc = Sitecore;

    namespace Custom.Sitecore.Extensions.Pipelines
    {
        using Sc.ExperienceEditor.Speak.Server.Contexts;
        using Sc.ExperienceEditor.Speak.Server.Requests;
        using Sc.ExperienceEditor.Speak.Server.Responses;

        public class MyItemsCountRequest : PipelineProcessorRequest<ItemContext>
        {
            public override PipelineProcessorResponseValue ProcessRequest()
            {
                return new PipelineProcessorResponseValue { Value = 0 };
            }
        }
    }

Add a config patch like so:

<sitecore.experienceeditor.speak.requests>
            <request name="ExperienceEditor.MyItems.Count">
                <patch:attribute name="type">Custom.Sitecore.Extensions.Pipelines.MyItemsCountRequest, Custom.Sitecore.Extensions</patch:attribute>
            </request>
</sitecore.experienceeditor.speak.requests>

In addition to this you may also want to also disable content testing functionality:

https://kb.sitecore.net/articles/785358

Or patch in an pipeline similar to the above for Optimization.SuggestedTests.Count like so: https://blog.horizontalintegration.com/2015/07/05/sitecore8-experience-editor-slow/

This should give you further performance gains in Experience Editor.

2
  • Ok, so your solution to speed up the experience editor is to always return 0 for the MyItemsCount. Just want to mention that it's probably also a solution to just remove the button from the ribbon.
    – Koen Heye
    Commented Feb 18, 2017 at 12:03
  • Yeah, removing it from the Ribbon is also suggested in some of the links above and Sitecores suggested tests count fix also involved doing that prior to 8.1 but i think it's more visible to the dev team and easier to roll back the change after an upgrade If it's done through config and a pipeline. That's definitely an option though. Commented Feb 18, 2017 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.