0

Using Sitecore 10.0.1 I need to change the Prefetch and AccessResultCacheSize to 500 MB

The Prefetch cache size is set as below in one config file

<prefetch hint="raw:AddPrefetch">
<sc.include file="/App_Config/Prefetch/Common.config" />
<sc.include file="/App_Config/Prefetch/Master.config" /></prefetch>

Inside the Master.config file, the below code is written

  <?xml version="1.0" encoding="utf-8" ?><configuration<cacheSize>300MB</cacheSize </configuration>

And, AccessResultCacheSize is set as below in xyz.config

<?xml version="1.0" encoding="utf-8"?>

 <settings>
<setting name="Caching.AccessResultCacheSize" s:value="50MB" /></settings></sitecore>

How to write patch file to change both above values to 500 MB

2 Answers 2

1

To configure Item and Data cache values, create a patch file for cache size values. For example, custom.caching.config and add the following

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <databases>
      <database id="web" role:require="ContentDelivery or Standalone">
        <cacheSizes>
           <data>1000MB</data>
           <items>1000MB</items>
        </cacheSizes>
      </database>
      <database id="master" role:require="Standalone or ContentManagement">
        <cacheSizes>
            <data>1000MB</data>
            <items>1000MB</items>
        </cacheSizes>
       </database>
    </databases>
    <settings>
      <setting name="Caching.AccessResultCacheSize">
        <patch:attribute name="value">10000</patch:attribute>
      </setting>
    </settings>
  </sitecore>
</configuration>

Refer to this document for more details.

Add this patch for the prefetch cache size.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <caches>
      <cache name="prefetch">
        <param desc="Size (MB)">50MB</param>
      </cache>
    </caches>
  </sitecore>
</configuration>

Hope it helps.

3
  • @coder try the updated answer solution Nov 7, 2023 at 12:32
  • The first solution you gave is working for id=master. But for id=web it throwing error "Could not find property 'dataProvider' on object of type: Sitecore.Data.SqlServer.SqlServerDataProvider "
    – coder
    Nov 7, 2023 at 13:25
  • This is working now.
    – coder
    Nov 7, 2023 at 13:34
2

Add the below patch file to your project. The below patch file has a patch for Prefetch, Data, Item, HTML, and AccessResultCache values with respective Content Delivery and Content Management roles defined.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
               xmlns:set="http://www.sitecore.net/xmlconfig/set/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
    <sitecore>
        <databases>
            <database id="master" role:require="ContentManagement or Standalone">
                <dataProviders>
                    <dataProvider>
                        <param desc="headProvider">
                            <dataProvider>
                                <prefetch>
                                    <cacheSize>1000MB</cacheSize>
                                </prefetch>
                            </dataProvider>
                        </param>
                    </dataProvider>
                </dataProviders>
                <cacheSizes hint="setting">
                    <data>1000MB</data>
                    <items>1000MB</items>
                </cacheSizes>
            </database>
            <database id="web" role:require="ContentDelivery or Standalone">
                <dataProviders>
                    <dataProvider>
                        <param desc="headProvider">
                            <dataProvider>
                                <prefetch>
                                    <cacheSize>1000MB</cacheSize>
                                </prefetch>
                            </dataProvider>
                        </param>
                    </dataProvider>
                </dataProviders>
                <cacheSizes hint="setting">
                    <data>1000MB</data>
                    <items>1000MB</items>
                </cacheSizes>
            </database>
        </databases>
        <sites role:require="ContentDelivery or Standalone">
            <site name="website" htmlCacheSize="200MB"/>
        </sites>
        <settings>
            <setting name="Caching.AccessResultCacheSize" value="200MB">
            </setting>
        </settings>
    </sitecore>
</configuration>

See the blog Post for more details: Cache Tunning in Sitecore

0

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.