tunghk_54
tunghk_54

Reputation: 135

Why does the cache need to be cleared to affect any hook_menu() change?

I create simple module to test hook_menu() function

my_menu()
{
    $item["abc"] = array(
    "title"=> t("abc")
    "page callback"=> "my_page");
    return $item;
}

Whenever I change "title" of item (to "ABC for example"), I wonder why the cache needs to be cleared to take affect.

Upvotes: 0

Views: 130

Answers (1)

ceejayoz
ceejayoz

Reputation: 180176

Because menus are cached for performance reasons. Building the site's menus takes a hefty amount of processing, which would slow down the site if done on every pageview.

Upvotes: 4

Related Questions