What does it do?

This module can provide a performance boost by reducing the processing time needed to render menus.

What type of sites can benefit from this module?

The performance increase available by using this module will be greatest for sites having:

  • A main menu or multiple menus with a few hundred menu items or more.
  • Access checks on menu items which involve database queries or other slow operations.
  • Large numbers of pages and visits.

Small sites are unlikely to see any significant benefit from using this module.

How large an improvement can be gained?

The bigger the volumes and the slower the access checks, the greater the improvement that is likely to be achieved. In a simulation with a main menu having 300 items and access checks requiring 10ms execution time, we found a 3 to 5 times improvement in average page load time shortly after clearing caches. YMMV.

There will most likely be no advantage, compared with using standard menus, once all pages are fully cached, other than a small reduction in cache memory use.

Where does this performance improvement come from?

Standard Drupal menus include active trail information. Because that is different for every page, individual menu structures have to be built for each page. With a Trailless Menu, a single cached structure can be shared for all pages. When caches have recently been cleared, this means that there is a far greater probability that a visitor will hit a page where the menu is already in cache.

Advantages

  • Faster performance and reduced loading, especially after caches have been cleared.

Downsides

  • Highlighting the active-trail menu items, if required, will need to be done via JavaScript rather than CSS alone.
  • Menus will not automatically display as expanded. Again, JavaScript must be used to achieve this, if required.

How do I use it?

  • After installing the module, just go to its configuration page and select which menus you want to build as trailless.

How can I check whether it's effective on my site?

  • After clearing caches, measure page load times for several pages which share the same menu.
  • Repeat this test with and without menus set trailless.
Supporting organizations: 
Further development and maintenance
Initial contribution

Project information

Releases