Cache strategy

Hi, I’ve created a navigation menu with items displayed for certain User’s role, using extensions Nestedset and Rbac. Now, every time nav menu is generated it loads 1 query in permission table for each item in nav menu to check if user can display menu item and this is no good. I can add that each navigation menu is different for each user’s role (but I’m planning to make it customized for each User), so I don’t know wich cache strategy adopt to make it lightweight. Any hint? I never used cache system before, so any link/resource will be appreciated :)


I’ve never used the cache, so I can’t help you there.

For the menu you might want to use the approach where you create a ‘master’-item. This item is in fact the menu name. Use RBAC to deside if you need to display this item or not.

If this item can be displayed, don’t display the item itself but display the submenu below it instead.

This way you need to perform RBAC on only 1 menu item for each menu structure.

Yes, of course… if an item must be not displayed all subitems will not be displyed too. Anyway I need 1 query for each 1 displayed item.

Isn’t there an extension of rbac with internal caching? There is some thread about it I think.

Don’t know… I’ve tried to search but you have to admit that internal searching in this forum… sucks :confused:

I think this was the thread - not sure. Maybe it helps.