We are using client side javascript to get navigation terms from the term store and their manage navigation friendly urls as well as some custom properties for how the navigation behaves. This is the relevant bit of code for getting the values from the term store.

var ctx = SP.ClientContext.get_current();
var session = SP.Taxonomy.TaxonomySession.getTaxonomySession(ctx);
var termSet = session.getDefaultSiteCollectionTermStore().getTermSet(setGuid);
var terms = termSet.getAllTerms();

The code works and gets the values we need. When I was first developing this on a test termset it took about 45 to 80 milliseconds to retrieve the data. Then when we switched to our actually site termset it exploded to 6 to 9 seconds! Which of course wasn't good because users don't know to wait up to 9 seconds before the navigation appears.

In an extensive debugging session (and much hair pulled out of my head) I discovered the reason. Under the Intended use tab for the term set I had turned off the Available for Tagging.

enter image description here

With available for tagging turned off the same call takes approximately 1000 times longer than it does if available for tagging is checked.

Can anyone provide clues to why this should be the case?

For this use we don't need the set to be available for tagging, but it won't hurt. But what if we couldn't turn it on? Would we just have to live with 1000 times longer calls?

Your Answer

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

Browse other questions tagged or ask your own question.