Skip to content

Instantly share code, notes, and snippets.

@pbering
Last active January 29, 2023 12:20
Show Gist options
  • Save pbering/e3866e452c75e030e710f62d267dbb4e to your computer and use it in GitHub Desktop.
Save pbering/e3866e452c75e030e710f62d267dbb4e to your computer and use it in GitHub Desktop.
Sitecore Performance (Docker friendly)
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<initialize>
<processor type="Sitecore.Pipelines.Loader.ShowVersion, Sitecore.Kernel">
<patch:delete />
</processor>
<processor type="Sitecore.Pipelines.Loader.ShowHistory, Sitecore.Kernel">
<patch:delete />
</processor>
<processor type="Sitecore.Analytics.Pipelines.Initialize.ShowXdbInfo, Sitecore.Analytics">
<patch:delete />
</processor>
<processor type="Sitecore.Pipelines.Loader.DumpConfigurationFiles, Sitecore.Kernel">
<patch:delete />
</processor>
</initialize>
</pipelines>
<hooks>
<hook type="Sitecore.Diagnostics.MemoryMonitorHook, Sitecore.Kernel">
<patch:delete />
</hook>
<hook type="Sitecore.Diagnostics.HealthMonitorHook, Sitecore.Kernel">
<patch:delete />
</hook>
</hooks>
<scheduling>
<agent type="Sitecore.Tasks.CounterDumpAgent">
<patch:delete />
</agent>
<agent type="Sitecore.Tasks.UrlAgent">
<patch:delete />
</agent>
<agent type="Sitecore.Tasks.CloneNotificationsCleanupAgent">
<patch:delete />
</agent>
<agent type="Sitecore.Tasks.CleanupFDAObsoleteMediaData">
<patch:delete />
</agent>
<agent type="Sitecore.Tasks.WebDAVOptionsCleanupAgent">
<patch:delete />
</agent>
<agent type="Sitecore.PathAnalyzer.Client.Tasks.HelpUpdateAgent,Sitecore.PathAnalyzer.Client">
<patch:delete />
</agent>
<agent type="Sitecore.PathAnalyzer.Client.Tasks.HelpUpdateAgent,Sitecore.PathAnalyzer.Client" desc="PageExplorer Help">
<patch:delete />
</agent>
<agent type="Sitecore.PathAnalyzer.Client.Tasks.HelpUpdateAgent,Sitecore.PathAnalyzer.Client" desc="PathAnalyzer Help">
<patch:delete />
</agent>
<agent type="Sitecore.Tasks.PublishAgent">
<patch:delete />
</agent>
<agent type="Sitecore.Tasks.HtmlCacheClearAgent">
<patch:delete />
</agent>
<agent type="Sitecore.ListManagement.Operations.UpdateListOperationsAgent, Sitecore.ListManagement">
<patch:delete />
</agent>
</scheduling>
<watchers>
<media>
<patch:delete />
</media>
<xsl>
<patch:delete />
</xsl>
<layout>
<patch:delete />
</layout>
<config>
<patch:delete />
</config>
</watchers>
<databases>
<database id="core">
<dataProviders>
<dataProvider>
<prefetch>
<cacheSize>300MB</cacheSize>
</prefetch>
</dataProvider>
</dataProviders>
</database>
</databases>
<settings>
<setting name="Xdb.Tracking.Enabled">
<patch:attribute name="value">false</patch:attribute>
</setting>
<setting name="Counters.Enabled">
<patch:attribute name="value">false</patch:attribute>
</setting>
<setting name="ItemCloning.Enabled">
<patch:attribute name="value">false</patch:attribute>
</setting>
<setting name="DeviceDetection.Enabled">
<patch:attribute name="value">false</patch:attribute>
</setting>
<setting name="Analytics.PerformLookup">
<patch:attribute name="value">false</patch:attribute>
</setting>
<setting name="Media.RequestProtection.Logging.Enabled">
<patch:attribute name="value">false</patch:attribute>
</setting>
<setting name="WebDAV.Enabled">
<patch:attribute name="value">false</patch:attribute>
</setting>
<setting name="ContentTesting.AutomaticContentTesting.Enabled">
<patch:attribute name="value">false</patch:attribute>
</setting>
<setting name="WebEdit.ShowNumberOfLockedItemsOnButton">
<patch:attribute name="value">false</patch:attribute>
</setting>
<setting name="ContentEditor.CheckHasChildrenOnTreeNodes">
<patch:attribute name="value">false</patch:attribute>
</setting>
</settings>
</sitecore>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<location path="sitecore" xdt:Locator="Match(path)" xdt:Transform="InsertIfMissing">
<system.webServer xdt:Transform="InsertIfMissing">
<staticContent xdt:Transform="InsertIfMissing">
<clientCache xdt:Transform="InsertIfMissing" cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" />
</staticContent>
</system.webServer>
</location>
<location path="temp" xdt:Locator="Match(path)" xdt:Transform="InsertIfMissing">
<system.webServer xdt:Transform="InsertIfMissing">
<staticContent xdt:Transform="InsertIfMissing">
<clientCache xdt:Transform="InsertIfMissing" cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" />
</staticContent>
</system.webServer>
</location>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.web>
<compilation xdt:Transform="SetAttributes" optimizeCompilations="true" batch="false" enablePrefetchOptimization="true" profileGuidedOptimizations="All" />
</system.web>
<system.webServer>
<modules xdt:Transform="SetAttributes(runAllManagedModulesForAllRequests)" runAllManagedModulesForAllRequests="false">
<add xdt:Transform="Remove" xdt:Locator="Match(name)" name="SitecoreUploadWatcher" />
<add xdt:Transform="Remove" xdt:Locator="Match(name)" name="SitecoreXslWatcher" />
<add xdt:Transform="Remove" xdt:Locator="Match(name)" name="SitecoreLayoutWatcher" />
<add xdt:Transform="Remove" xdt:Locator="Match(name)" name="SitecoreConfigWatcher" />
<add xdt:Transform="Remove" xdt:Locator="Match(name)" name="MediaRequestSessionModule" />
</modules>
<handlers>
<add xdt:Transform="Remove" xdt:Locator="Match(name)" name="WebDAVRoot" />
<add xdt:Transform="Remove" xdt:Locator="Match(name)" name="WebDAVRoot64" />
<add xdt:Transform="Remove" xdt:Locator="Match(name)" name="Sitecore.WebDAVMediaRequestHandler" />
</handlers>
</system.webServer>
<runtime>
<generatePublisherEvidence xdt:Transform="InsertIfMissing" />
<generatePublisherEvidence xdt:Transform="SetAttributes" enabled="false" />
</runtime>
</configuration>
@nishbat
Copy link

nishbat commented Dec 13, 2018

Is it safe to apply this configurations in production environment?

@RosenPetrov
Copy link

RosenPetrov commented Jun 12, 2020

Great work! I am trying to apply it on Sitecore XP 9.3 in Docker. It looks like that the
runAllManagedModulesForAllRequests="false"
is causing issues in Content Editor and Control Panel. Some client scripts don't load because of "no owin:Environment in the session" error. I removed that xdt:Transform in order to make it work but it's not so fast anymore. Have you tested it for Sitecore 9.3?

@pbering
Copy link
Author

pbering commented Jun 19, 2020

Thanks! and yeah in 9.3 (especially XP) the runAllManagedModulesForAllRequests="false" is not good to use. But if you don't use tracking/xconnect stuff on the CD then you can use it there to get a little more throughput. The rest is working fine on 9.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment