admin quizzes menu item should be cached
Sean B Fuller - October 11, 2006 - 16:49
| Project: | Quiz |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | rfolk |
| Status: | closed |
Description
The admin's "quizzes" menu item disappears sometimes because it is being defined in the !$may_cache area of the hook_menu. It is also not listed on the menu page. It is a cacheable menu item and should be in that section for consistency.

#1
The admin's "quizzes" menu is now being defined in the $may_cache area of the hook_menu.
#2
Sorry... wrong patch.
#3
Please disregard the previous posts. Attached is the actual patch. Sorry about any confusion.
#4
Thanks Rachael! Sorry that the project issue interface was giving you are hard time. :)
#5
Maybe I misinterpreted the concept of the may_cache section - I thought it referred to the contents of the page.
Why would the menu item dissapear/appear based on your currently location in the site if it was in !$may_cache?
The reason I put it in the not cache area is because its a dynamic admin page - we dont want it to cache. But I'm getting the feeling I have really misinterpreted the point of $may_cache...
#6
As I understand it, "cache" here refers to the menu array. Menu items are not cached if they have dynamic arguments (such as node/$nid or user/$uid) as these have to be created on the fly. The menu array is only rebuilt when saving the modules list page and the settings page. Additionally, cached menu items (paths) have positive menu ids, whereas dynamic menu paths have negative ids. Cached menus are held in the globals vars.
Page caching takes a snapshot of the page and dumps it into the cache table.
I think some queries are also cached, such as node_load(). This allows drupal to make one sql query to get node data instead of all the nodeapi load queries, etc.
There may be more, but that's how I understand it. Multiple types of performance enhances that are all referred to as "caching" at various times.
#7
Ah right - so $may_cache applies to the menu item itself, not the page! I know that pretty much everything gets cached at some point or another, but I thought may_cache applied to the page not the menu.
You explanation makes sense though.
#8
Committed
#9