Ways to speed up menu generation (multiple SQL queries)

Hi,
for the past few days I’ve been trying to find a way to speed up cs-cart.

I have a store with alot of updates so the cache is cleared really often. They way current cs-cart cache works in my scenario make my store to work most of the time without cache.

The only way to speed things up is to make the store work fast without cache.

I’ve found out via the debbuger that if there are alot of categories the function fn_top_menu_form creates hundreds of queries in order to generate menu tree.

In my opinion it would be alot better to generate the tree via single query or maybe with multiquery, rather than querying database with hundreds small queries. Has anyone ever investigated it? Am I missing something?

I would really appreciate some feedback from developers. Maybe it’s possible to optimize this part of cs-cart code :wink:

Hello!

It is very strange situation in which your cache is updated that often, that it simply isn’t used, at least for the menu block.

In order to speed up this function you need to decrease the total quantity of categories that exist in your store. You can also try to switch to manual menu and add there only those categories, that you wish to display:
https://docs.cs-cart.com/latest/user_guide/look_and_feel/menus/index.html