Implement Category Predecessor Cache
|Target version:||v0.7.0 - Misc Pages & UI|
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.