Refactor #1544

Implement Category Predecessor Cache

Added by Anonymous 9 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:Anonymous% Done:


Category:CategoriesSpent time:-
Target version:v0.7.0 - Misc Pages & UI
Easy Pickings:


Currently, when we need to fetch the predecessors for a category, we do a single query for each level of category nesting.

This gets intensive for some pages, e.g. any page that checks for category sales & the products/category details pages.

Instead, we should keep a Map CategoryId [CategoryId] in the application config that maps a category to a list of it's predecessors. Then we can simply pull the value out of there instead of running a ridiculous amount of many queries.

Make sure to update the map when changes are made to the categories via the Category Admin.

Also available in: Atom PDF