Performance issue with TaxonomyManager.GetTree(path)

121 views Asked by At

I am using TaxonomyManager gettree(path) method to get a particular tree hierarchy in my c# code but it is taking more than 3 min to get the result, due to this the website is taking long time to load. How to reduce the time to load the website, is there any other way i can use to get the hierarchy from Ektron.

1

There are 1 answers

0
abenbot On

We had this exact same issue and actually got on with Ektron support to help resolve it.

Now, whenever we work with taxonomies we cache them on the server-side to avoid the performance hit. Something like

string cacheKey = "Something unique for your situation";
TaxonomyData taxonomyData;

if (Ektron.Cms.Context.HttpContext.Cache[cacheKey] == null)
{
    // Pull taxonomy data and store in cache.
    Ektron.Cms.Context.HttpContext.Cache.Insert(cacheKey, taxonomyData);
}
else 
{
    taxonomyData = (TaxonomyData)Ektron.Cms.Context.HttpContext.Cache[cacheKey];
}

Since you already know how to pull the TaxonomyData I left that out. We don't store the taxonomy data, instead we store the object we create with the taxonomy data, so just cache whatever you need to and then you can avoid the performance hit 'most' of the time.

I don't remember where the ektron cache time is set, whether it's in the web.config or within the WorkArea. Ektron support said to use the Ektron cache, not sure how much of a difference it would make to use the regular cache instead.