Basically I have many categories and it takes too slow for me to load categories.
In the ProductController.cs line 773 (version 3.5)
line below is executed really slow. What is it for and Can i somehow optimize it?
why are the categories loaded anyway? are they not cached? it should be fast to load from the cache
//categories
model.AvailableCategories.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" });
var categories = _categoryService.GetAllCategories(showHidden: true);
foreach (var c in categories)
model.AvailableCategories.Add(new SelectListItem { Text = c.GetFormattedBreadCrumb(categories), Value = c.Id.ToString() });