Is your Sitecore application having slow start-up time and want to improve it? The main reason behind slowness is bigger Prefetch Cache. Application's startup time is directly proportional to size of Prefetch Cache set.
If you set Bigger Prefetch, it gives slow startup, but it can give you better performance while opening Content Editor or Page Editor because your items' data are already fetched from Database to Prefetch Cache.
In reverse, if you get Smaller Prefetch, it gives fast startup, but it can give you less performance while opening Content Editor or Page Editor because your items' might not be fetched to Prefetch from database. Thus, setting bigger or smaller amount of Prefetch, both have their own pros and cons.
- Which are the pages used the most in your site like Homepage.
- Which are the pages, whose children are accessed frequently.
- Which kind of pages(templates) are used the most.
Then, try to Prefetch all those items which are used in these pages.
For example,
- Homepage is the most frequently visited page, then you should prefetch Home item and its immediate children.
- Similarly suppose News pages are visited frequently, then you should prefetch News Template and their children too.
The Sitecore Prefetch Cache is a bit of a gray area. But, the above settings work great and surely help you to improve application startup.
If you are new to Sitecore cache, refer How Sitecore Caching Work and Performance Improvement Techniques.
Enjoy quick start up!!
If you set Bigger Prefetch, it gives slow startup, but it can give you better performance while opening Content Editor or Page Editor because your items' data are already fetched from Database to Prefetch Cache.
In reverse, if you get Smaller Prefetch, it gives fast startup, but it can give you less performance while opening Content Editor or Page Editor because your items' might not be fetched to Prefetch from database. Thus, setting bigger or smaller amount of Prefetch, both have their own pros and cons.
Prefetch Cache Best Practices
If prefetch is customized according to our use of pages of site, it will give you the best performance. For that you have to findout three things:- Which are the pages used the most in your site like Homepage.
- Which are the pages, whose children are accessed frequently.
- Which kind of pages(templates) are used the most.
Then, try to Prefetch all those items which are used in these pages.
For example,
- Homepage is the most frequently visited page, then you should prefetch Home item and its immediate children.
- Similarly suppose News pages are visited frequently, then you should prefetch News Template and their children too.
How to configure Prefetch Cache
Open the prefetch cache settings under the App_Config/Prefetch/ folder. For example /App_Config/Prefetch/Web.Config:300MB 100 {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}- {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX }
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
See how these configurations will work:
-
<cachesize>300MB</cachesize>
describes Sitecore will do prefetch upto 300MB. - <template desc="mytemplate">{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}</template>
Defines that items of the specified template will be prefetched. - <item desc="myitem">{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX }</item>
Defines that the specified item will be prefetched. - <children desc="childitems">{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}</children>
Defines that specified children of the given item will be prefetched. - <childlimit>100</childlimit>
Defines a limit to the number of children to include in the prefetch cache.
The Sitecore Prefetch Cache is a bit of a gray area. But, the above settings work great and surely help you to improve application startup.
If you are new to Sitecore cache, refer How Sitecore Caching Work and Performance Improvement Techniques.
Enjoy quick start up!!
No comments:
Post a Comment