Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which Sitecore caches are affected by Caching.ScavengeInterval, and how?

Looking at caching settings in the web.config I came across the Caching.ScavengeInterval entry:

<!--  SCAVENGE INTERVAL
Determines how often scavengable caches are scavenged.
Default value: 3 minutes.
-->
<setting name="Caching.ScavengeInterval" value="00:03:00" />

Which caches does it affect, and is there automatic cache scavenging built in to Sitecore? What does Cache scavenging do in a Sitecore context?

I'm particularly interested in whether it affects IsUserInRole caching.

like image 700
James Walford Avatar asked Jan 27 '14 16:01

James Walford


People also ask

What is caching and types of caching in Sitecore?

Cache Basics. Sitecore uses various caches to store data, rendered presentation logic and other information in memory in order to improve performance and response time. A cache is a dictionary that keeps track of when each entry is accessed. The data that is stored for each entry depends on the cache.

Which one of the cache is based on per managed database in Sitecore?

Sitecore populates database prefetch caches at application initialization, and maintains those caches over the life of the application.

What happens if we set data caching option in Sitecore?

Caching to improve performance. You can improve the load time of your SXA web pages by setting the caching options for the SXA renderings. The SXA HTML cache minimizes the number of times Sitecore processes renderings. This is very important, especially if you have renderings that iterate over a large amount of items.


1 Answers

This isn't going to answer your question directly, but hopefully it will give a push in the right direction.

You can use Sitecore Rocks to view the current caches, there is a column which tells you which caches are flagged to be scavengable:

http://www.sitecore.net/Community/Technical-Blogs/Trevor-Campbell/Posts/2013/02/28-Days-of-Sitecore-Rocks-Manage-Part-3.aspx

On a default install of Sitecore it only affects GeoIp and ClientDataStore. Unfortunately:

The client data store cache stores information about each authenticated user, such as the username or other user properties.

Sitecore Cache Configuration Guide - page 20

That is the wrong cache for your needs, you are interested in the IsUserInRoleCache and that is flagged as Scavengable:false

You can dig into yourself, use dotPeek decompiler and take a look at the following class in Sitecore.Kernel.dll:

  • Sitecore.Caching.Cache
  • Sitecore.Caching.CacheManager
  • Sitecore.Configuration.ClientDataStore
like image 170
jammykam Avatar answered Oct 12 '22 13:10

jammykam