Thursday, January 03, 2008

Drupal menu cache

There's an very annoying issue in drupal menu. Suppose you are writing your own module and register it with some menu paths. What if later on you want to change some of the path setting in your module, for example, changing access privilege of a form. I discovered that even I save all my modification, my drupal site still not getting anything changed.
After some diggings, the main cause of these problem is the menu_cache table, where it cache the meun path for fast access. Root cause, modifying the module menu path does not automatically update the menu_cache table. Action, clean all cache in the menu_cache table, the change gets reflected.

Note: Caching cause a lot of confusion when developing in drupal, getting an understanding of how caching mechanism work in drupal is necessary. Also, sometimes is useful to clean cache of your browser when testing.