11

It is my understanding that there are various different caches in Sitecore.

What are they for?

I know there is an item cache, a html cache and a prefetch cache, but I don't understand how they differ or how I can control these caches

13

Prefetch cache

This is item data pulled out from the database when the site starts up - from the Sitecore docs:

"Each database prefetch cache entry represents an item in a database. Database prefetch cache entries include all field values for all versions of that item, and information about the parent and children of the item.

Populating the prefetch cache results in smoother user experiences immediately after application restarts. Excessive use of prefetch caches can affect the time required for application initialization."

Data cache

This cache is to minimise the round trips to the database, it again pulls item information from Sitecore but the difference being it does it when the item is requested (rather than start-up of the site); it will pull the data from the pre-fetch cache if it's there or go back to the database if not.

Item cache

This cache has objects of type Sitecore.Data.Items.Item which would be used in code; when an item is requested in code it will look in the Item cache, then back up the data cache and up again to pre fetch cache and finally to the database.

HTML cache

This output caches the HTML from sublayouts and renderings, there are a nice level of configuration to only cache the HTML based on querystrings, different data etc.

Flow of cache

The following is taken from http://learnsitecore.cmsuniverse.net/Developers/Articles/2009/07/CachingOverview.aspx

Cache flow from Learn Sitecore

References

Some of these references are a bit old, but I don't believe this part of Sitecore has changed that much over the years.

4

Here you can find detailed info about cache. In essence:

prefetch

Database prefetch caches contain items that Sitecore accesses during and immediately after initialization, and items with children that Sitecore often accesses as a group. Sitecore populates database prefetch caches at application initialization, and maintains those caches over the life of the application. Each database prefetch cache stores data from a different database or data source. Not all data providers implement prefetch caches.

item

Database item caches store items. Database item caches are dependent on database data caches, which operate at a lower level. Each entry in a database item cache represents a single version of an item in a single language. Sitecore does not pre-populate database item caches.

HTML

The HTML cache (also known as the output cache) associated with each managed Web site contains the output generated by individual renderings under different conditions. Each site HTML (output) cache is dependent on the database item cache.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.