Yii Framework Forum: Cache strategy - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cache strategy for a nav menu created with Rbac+nestedset Rate Topic: -----

#1 User is offline   zitter 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 140
  • Joined: 14-July 09

Posted 20 April 2010 - 02:20 AM

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 :)

Danilo
0

#2 User is offline   Onman 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 175
  • Joined: 26-December 09
  • Location:The Netherlands

Posted 20 April 2010 - 04:11 AM

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.
0

#3 User is offline   zitter 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 140
  • Joined: 14-July 09

Posted 20 April 2010 - 10:52 AM

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.
0

#4 User is offline   Y!! 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 978
  • Joined: 18-June 09

Posted 20 April 2010 - 10:55 AM

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

#5 User is offline   zitter 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 140
  • Joined: 14-July 09

Posted 20 April 2010 - 11:24 AM

View PostY!!, on 20 April 2010 - 10:55 AM, said:

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 :/
0

#6 User is offline   Y!! 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 978
  • Joined: 18-June 09

Posted 20 April 2010 - 11:47 AM

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users