[development] The menu - does it have to be different on each page?

Gerhard Killesreiter gerhard at killesreiter.de
Tue Aug 29 22:09:26 UTC 2006


Hi there,

In my endeavour to have better caching in Drupal. One of the things we 
already cache is the menu tree for each user. What we cannot cache is 
the rendered version of this tree (the navigation block) because it 
changes on each and every page.

I was wondering if we need this. Couldn't we always render the complete 
menu and only hide the pieces we don't want to show through some CSS/JS?

Sure, this would put users of non-CSS browsers maybe at an disadvantage, 
but is it that bad? If you are not an admin the number of additional 
items is rather small.

One problem that has been pointed out is that we add the "active" class 
to the current menu item. Would there be a way around this?

Caching the whole rendered menu block would have some serious 
performance implications.

Cheers,
	Gerhard


More information about the development mailing list