Sitecore 优化,加快应用每次重新 loading 速度。
IIS 优化
1. 设置 AlwaysRunninng
前往应用池选中对应的站点,点击高级设置,在 Start Mode 那列选中 AlwaysRunning,最后保存。
2. 设置 Preload Enabled 为 True
在站点列选中你的站点,点击高级设置,将 Preload Enabled 设置 True,然后保存。
3. 设置 doAppInitAfterRestart 为 True
- 在站点的面板里,找到 Management 组下的 Configuration Editor,双击打开,在 Section 下拉列表中选择 applicationInitialization,然后设置 doAppInitAfterRestart 为 True。
- 然后在 collection 添加一个新的数据, hostName 为携带 http的host,initializationPage 设置为 /,然后关闭 collection 窗口并点击应用按钮。
Solr 优化
- 前往 "【Solr Instance】/bin" 文件夹。
- 使用文本编辑器打开 solr.in.cmd 文件。
- 在文件最底部添加下面两列内容:
a.set SOLR_TIMEZONE="UTC+8"
b.set SOLR_JAVA_MEM=-Xms512m -Xmx512m
- 重启 Solr 服务。
Sitecore 优化
参考:
打入此补丁文件:
PerformanceOptimization.config
<?xml version="1.0"?>
<!-- This config only for Development environment for Performance -->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
xmlns:role="http://www.sitecore.net/xmlconfig/role/"
xmlns:environment="http://www.sitecore.net/xmlconfig/environment/">
<sitecore environment:require="DEV">
<hooks>
<!-- Only Disable for DEV for development performance -->
<hook type="Sitecore.Diagnostics.HealthMonitorHook, Sitecore.Kernel">
<patch:delete />
</hook>
</hooks>
<scheduling>
<agent type="Sitecore.Tasks.CounterDumpAgent">
<patch:delete />
</agent>
</scheduling>
<pipelines>
<httpRequestEnd>
<processor type="Sitecore.Pipelines.HttpRequest.StopMeasurements, Sitecore.Kernel">
<ShowThresholdWarnings>false</ShowThresholdWarnings>
<TimingThreshold desc="Milliseconds">1000000</TimingThreshold>
<ItemThreshold desc="Item count">1000000</ItemThreshold>
<MemoryThreshold desc="KB">10000000</MemoryThreshold>
</processor>
</httpRequestEnd>
<healthMonitor>
<processor type="Sitecore.Pipelines.HealthMonitor.HealthMonitor, Sitecore.Kernel" method="LogCounterStatus">
<patch:delete />
</processor>
</healthMonitor>
<contentSearch.queryWarmup patch:source="Sitecore.ContentSearch.config">
<processor type="Sitecore.ContentSearch.Pipelines.QueryWarmups.RunQueries, Sitecore.ContentSearch">
<patch:delete />
</processor>
</contentSearch.queryWarmup>
<initialize>
<processor type="Sitecore.Pipelines.Loader.ShowHistory, Sitecore.Kernel">
<patch:delete />
</processor>
<!-- Disable speak precompilations; this increases first hit dialog load time but incrementally reduces instance startup time after a compile -->
<processor type="Sitecore.Pipelines.Initialize.PrecompileSpeakViews, Sitecore.Speak.Web">
<patch:delete />
</processor>
<processor type="Sitecore.Pipelines.Loader.DumpConfigurationFiles, Sitecore.Kernel">
<patch:delete />
</processor>
</initialize>
</pipelines>
<settings>
<setting name="ContentTesting.AutomaticContentTesting.Enabled">
<patch:attribute name="value">false</patch:attribute>
</setting>
<setting name="ContentEditor.CheckSecurityOnTreeNodes">
<patch:attribute name="value">false</patch:attribute>
</setting>
<setting name="ContentEditor.CheckHasChildrenOnTreeNodes">
<patch:attribute name="value">false</patch:attribute>
</setting>
<!-- Remove Lock Item Count to improve Experience Editor Performance -->
<setting name="WebEdit.ShowNumberOfLockedItemsOnButton" role:require="Standalone or ContentManagement">
<patch:attribute name="value">false</patch:attribute>
</setting>
<!-- Better Performance when open Content Editor -->
<setting name="ContentEditor.RenderCollapsedSections" value="false" role:require="ContentManagement or Standalone" />
</settings>
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<!-- Solr Index-->
<index id="sitecore_suggested_test_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
<configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration">
<fieldMap ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration/fieldMap">
<fieldNames hint="raw:AddFieldByFieldName">
<field fieldName="impact" returnType="double">
<patch:delete />
</field>
<field fieldName="potential" returnType="double">
<patch:delete />
</field>
<field fieldName="recommendation" returnType="double">
<patch:delete />
</field>
</fieldNames>
</fieldMap>
<documentOptions ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration/documentOptions">
<fields hint="raw:AddComputedIndexField">
<field fieldName="impact" returnType="double" type="Sitecore.ContentTesting.ContentSearch.ComputedIndexFields.TestImpactMetric, Sitecore.ContentTesting">
<patch:delete />
</field>
<field fieldName="potential" returnType="double" type="Sitecore.ContentTesting.ContentSearch.ComputedIndexFields.TestPotentialMetric, Sitecore.ContentTesting">
<patch:delete />
</field>
<field fieldName="recommendation" returnType="double" type="Sitecore.ContentTesting.ContentSearch.ComputedIndexFields.TestRecommendationMetric, Sitecore.ContentTesting">
<patch:delete />
</field>
</fields>
</documentOptions>
</configuration>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>