Wildcard Loader function called multiple times (_load) I have a loader function which is called excessively whenever the user accesses the page. Naturally, I only need it to run once per page request, instead, it is called multiple times. Earlier the _load() ran only twice with MENU_CALLBACK, then I tested it with the default MENU_NORMAL_ITEM and it increased to four. Although I've changed it back, and cleared my cache, it still runs four times now, and I only want it to run once. 

My question is, why is my loader function being called multiple times? Any insight would be greatly appreciated.

$items['daycare/%isValid/home'] = array(
    'title' =&gt; 'Daycare Admin Home',
    'page callback' =&gt; 'daycares_home_page',
    'load arguments' =&gt; array(0),//Passes 1st part of url 'daycare' as 2nd arg
    'page arguments' =&gt; array(0),
    'access arguments' =&gt; array('access content'),
    'type' =&gt; MENU_CALLBACK,
);

function isValid_load($pageID, $pageType){
    /*Do stuff to validate wildcard part of URL. Will throw 404/403 if invalid*/
    return $pageId;
}
There's an issue for this. It looks like you have to implement caching in your loader.

I was curious and tried it out on admin/structure/types/manage/%node_type. I grepped for node_type_load and nothing seemed to be calling it directly, so I put a ddebug_backtrace() in the load function. I got 13 traces when visiting that path! 10 of these came from menu_local_tasks() which loops through the local tasks and calls _menu_translate() which calls _menu_load_objects() for each router item. The other two extra calls came via menu_set_active_trail() which also called _menu_translate(). So I guess it depends on your menu structure how many times a loader might be called. As far as I can tell the object's loaded only to check whether or not it can be (access is denied if it can't). I guess this just reinforces Damien's comment about implementing static caching in your loader.