Try our conversational search powered by Generative AI!

Performance issues with IContentRepository methods


Hi Team,

My application is facing lot of performance issues with IContentRepository methods. Always first requesting is taking minimum of 10 seconds to get any content page by using IContentRepository.Get<T>(ContentReference contentLink) method. From sencond request onwards it is quick.

Whenever application is in ideal state for 15min then first request always taking so much time to get the data. Because of this few of customers are facing performance issues.

I have idea that Episerver caches the content first time and from next time onwards retrieve from cache for quick response. I am not understanding why Get method is taking lot of time to retrieve when system is in ideal for sometime.

Am i missing any configuration settings? My current application is running in DXC environment.


Suresh B

Mar 06, 2020 17:53

I believe the default cache timeout for object cache is 12 hours - check the settings in web.config (episerver/applicationSettings - pageCacheSlidingExpiration-attribute) that you have not set a too short timeout for this. If you're in edit-mode, the pages are not loaded from cache, this is normal. 

If the cache settings look good and you're still seeing that the pages are not loaded from cache after a few minutes, this sounds like the application pool is being recycled. This could happen if you have a lot of exceptions that occur in a short time span so the IIS rapid fail protection is triggered - check the logs for any exceptions.

If you're still having problems, and it works as expected in your development environment, you should contact Episerver support who will hopefully be able to assist.  

On a side note, you should use IContentLoader instead of IContentRepository if you don't need to save/update content. 

Mar 06, 2020 19:45

Hi Tonvang,

Thanks for your update. applicatioSettings looks good and there are no application level exceptions.

May be i need to check with Episerver support team.


Suresh B

Mar 07, 2020 12:23

I would suggest to do a profiling of your request (using dotTrace is preferred) and send the result to the support team, that will speed up the process 

Mar 09, 2020 7:28
  1. Avoid having more than 100 immidiate children if possible. Add additional folder if needed to structure content. Good for editors, good for performance. 
    If you have news content, structure by year and month. If you have products, structure by category etc.
  2. If you have extremely many children below a single node (1000s) in tree you will get poor performance in edit mode and also for the GetChildren method in content repository. Solve this preferably by solving 1 above.
  3. Use GetBySegment on ContentRepository if possible when you have lots of children. Read more here

4. Avoid doing recursive searches in page tree / FindPagesByCriteria. Use Episerver Find or similar to get what you need instead or solve it in another way. And if you do use recursive search in tree, cache the result for the public user so you at least only do it once.

Edited, Mar 09, 2020 10:32

Hi Daniel,

Can we use "GetDescendants" to get all childrens under folders? Is this "GetDescendants" results get from content cache or from database?


Suresh B

Mar 10, 2020 16:10

Note that GetDescendents will be recursive, and it only returns the references of the descendents, not the descendents themselves. The default implementation uses GetChildren to get the direct children, so it will be cached or uncached, but then use direct database access (uncached IIRC) to get deeper level descendents 

Mar 10, 2020 16:16

Hi Quan,

Let's say i have below folder structure.








So here i have around 6000+ occupations categorized with industry folder structure. What is the best way to retrieve all occupations across all industries without performance impact?

I have requirement to show all occupations in searchable dropdown. I cannot use Episerver Find as it will return max 1000 records and i need to hit find service min 6 times to get all occuaptions.

Mar 10, 2020 16:29

Do you really need to display all 6000 occupations initially? If you use some searchable Javascript dropdown component you can create a rest api endpoint that searches Find and delay searching until the user has entered 2-3 characters or so. 

Mar 10, 2020 21:15

Yes, i need to display 6000 occupations. My requirement is, user can search or select from dropdown.

Mar 11, 2020 4:13

Your best option would be using an indexed search, like, Find, to load/search all contents instead of using the content API directly 

Mar 11, 2020 7:24

Even if you have to hit Find six times, it will still be faster than loading from DB. You can then cache the results, so it will only hit Find the first time. 

Mar 11, 2020 8:02
  1. Question the requirement. 
    It's probably best to first choose Industry first, and the show occupations below that using a paged result or similar. Usually there is a way around to avoid loading 6000+ entities at the same time.
  2. Use Find and get the result per Industry. 
  3. Cache it. Hard. That's not a call you want to make on a per user basis...
Mar 11, 2020 10:43

We are planning to change occupation selection behavior. Now going to integrate autosuggestion behavior.

I am referring below link for Episerver Find autocomplete example. Do we have any option to pass pagetype filter so i can only filter Occupations and get occupation specific results.

Mar 12, 2020 7:53
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.