4

Looks like out of the box prefetch cache setting has item and children set to items which no longer use. I've gone and added below on both master and web database settings.

<prefetch hint="raw:AddPrefetch"> 
  <cacheSize>500MB</cacheSize>
  <item desc="home">{4CE08AF0-CB20-40C2-BE74-BF049DE210B2}</item>
  <children desc="main items">{4CE08AF0-CB20-40C2-BE74-BF049DE210B2}</children>
</prefetch>

Where item is our Home node for the site. I assume children means prefetch all items underneath home node.

Questions:

  1. Do we need to include both master and web db settings in CMS? Or just master settings in CMS.
  2. Do we need to include master and web db settings in CD? Or just Web settings in CD.
  3. Where does sitecore stores the cache data for (item cache, data cache and prefetch cache). Wondering if any of them are stored in physical file.
  4. I'm using out of box cache page and also sitecore cache admin module (https://marketplace.sitecore.net/en/Modules/Sitecore_Cache_Admin.aspx)

    The page shows prefetch cache data for both web and master. Wondering how this tool gets the data for web db prefetch for scenario where there are multiple CDs. Or is it just getting from CMS server?

5.When I search for the prefetch item using above mentioned module, I can find it on master prefetch but not on web prefetch. Hence I'm wondering how it shows the prefetch items for Web DB from CMS server.

2 Answers 2

8
  1. Do we need to include both master and web db settings in CMS? Or just master settings in CMS. Only the master db will suffice. Web db items are only used when the site is accessed through the front-end which is usually not the case on CMS.
  2. Do we need to include master and web db settings in CD? Or just Web settings in CD. Only the web db. The master db is not accessible on CD servers (if configured correctly).
  3. Where does sitecore stores the cache data for (item cache, data cache and prefetch cache). Wondering if any of them are stored in physical file. They are stored in-memory on the instance, not on disk.
  4. I'm using out of box cache page and also sitecore cache admin module. The page shows prefetch cache data for both web and master. Wondering how this tool gets the data for web db prefetch for scenario where there are multiple CDs. Or is it just getting from CMS server? This is configured in the /App_Config/Prefetch/*.config files. There is one file for each database and one shared file.

Here are some helpful resources on prefetch cache:

10
  • Point 4. My question was whether the cache pages shows the correct details for web db prefetch. Wonder how does it read the prefetched items for each CDs if items are stored in memory. Or do i need to access from each CDs.
    – Nil Pun
    Commented Oct 24, 2016 at 7:31
  • Indeed, you need to access it from the CD Commented Oct 24, 2016 at 7:39
  • I assume if site is setup as distributed session state, then prefetch will also be on distributed?
    – Nil Pun
    Commented Oct 24, 2016 at 11:36
  • Nope, the cache is stored in-memory so each server has its own cache. Distributed session state only applied to session state, not to cache. Commented Oct 24, 2016 at 11:43
  • Hm... if prefetch cache is in-memory I'm curious on why there is a need for item and data cache (assuming these are also in in-memory cache).
    – Nil Pun
    Commented Oct 25, 2016 at 0:30
2

4. I'm using out of box cache page and also sitecore cache admin module (https://marketplace.sitecore.net/en/Modules/Sitecore_Cache_Admin.aspx) The page shows prefetch cache data for both web and master. Wondering how this tool gets the data for web db prefetch for scenario where there are multiple CDs. Or is it just getting from CMS server?

The given answer is not correct. The /sitecore/admin/Cache.aspx provides information about the prefetch cache (number of entries, overall size, delta size, max size). It has nothing to do with the App_Config\prefetch\*.config settings (other than the provided items are added to the prefetch during initialization). After initialization this cache will continue to grow as new items are requested from each database. Another way to look at this- you could remove all item entries in App_Config\prefetch from your installation and you will still have prefetch caches for all Sitecore databases and they will continue to grow with the application.

5.When I search for the prefetch item using above mentioned module, I can find it on master prefetch but not on web prefetch. Hence I'm wondering how it shows the prefetch items for Web DB from CMS server.

Do not confuse the App_Config\Prefetch instructions with the actual prefetch cache. These are entirely different things. The App_Config\Prefetch configs tell Sitecore which items to retrieve during application initialization. And as a result these items are added to the prefetch cache. This action only occurs one time during the lifetime of the application.

The prefetch cache, on the other hand, will include ANY item that is requested for a database. Therefore, while the previously mentioned config will seed the prefetch cache, all future requests will items will also be added to this cache.

This explains why the CMS shows entries for both the master and web databases. If any item is requested for the web database, then it will appear in the prefetch cache.

A more elaborate explanation can be found here.

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.