Sitecore AccessResultCache cache is cleared by Sitecore.Caching.Generics.Cache`1+DefaultScavengeStrategy[[Sitecore.Caching.AccessResultCacheKey

Are you getting a lot of these messages in your Sitecore log:

6052 2021:03:25 05:23:12 WARN AccessResultCache cache is cleared by Sitecore.Caching.Generics.Cache`1+DefaultScavengeStrategy[[Sitecore.Caching.AccessResultCacheKey, Sitecore.Kernel, Version=11.1.0.0, Culture=neutral, PublicKeyToken=null]] strategy. Cache running size was xxx MB.

This message can easily appear once every minute.

WHAT IS THE ACCESSRESULTCACHE?

Every time a user accesses an item, the security rights to that item is put into the accessresultcache.

WHY IS THE CACHE CLEARED SO OFTEN?

Sitecore have chosen a relatively low value as cache. This value suits smaller sites perfectly, but larger sites will suffer.

Also, remember that it is every item that is being read that is cached. So If you have a dropdown or a tree view, these items are read and cached too. Looking up one item in Sitecore might trigger a cascade reading of 100-s of items.

WHAT TO DO THEN?

You can increase the cache size easily:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" 
xmlns:set="http://www.sitecore.net/xmlconfig/set/">
    <sitecore>
        <settings>
              <setting name="Caching.AccessResultCacheSize" set:value="300MB"/>
        </settings>
    </sitecore>
</configuration>

CAN YOU DISABLE THE ACCESSRESULTCACHE?

Yes. If all of your Sitecore editors are admins anyway, you can disable the cache. You can also disable the cache on the CD servers if there is no security protected areas on your site. You disable the security per database:

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
  <sitecore>
    <databases>
      <database id="web">
        <securityEnabled>false</securityEnabled>
      </database>
    </databases>
  </sitecore>
</configuration>

MORE TO READ:

About briancaos

Developer at Pentia A/S since 2003. Have developed Web Applications using Sitecore Since Sitecore 4.1.
This entry was posted in Sitecore 6, Sitecore 7, Sitecore 8, Sitecore 9 and tagged , , . Bookmark the permalink.

1 Response to Sitecore AccessResultCache cache is cleared by Sitecore.Caching.Generics.Cache`1+DefaultScavengeStrategy[[Sitecore.Caching.AccessResultCacheKey

  1. Pingback: Sitecore high CPU usage – is the SQL Session State Provider the villain? | Brian Pedersen's Sitecore and .NET Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.