trendwerk / sphynx

A light & simple WordPress starter theme 😽
16 stars 2 forks source link

Performance: menu's #740

Open haroldangenent opened 8 years ago

haroldangenent commented 8 years ago

Adding the menu's to the Twig context is about 20% of every page load. This is quite a lot, considering menu's are not highly dynamic and hardly ever change.

Menu's could be either (heavily) cached or maybe even static (i.e. a footer menu). Dynamic menu's could always be created for projects with ACF or an ACF starter or library.

For cache, invalidation has to be taken into account, although not it's as important as in #739.

sboerrigter commented 8 years ago

I prefer caching over static menu's so our clients have some freedom to change the menu's. I am affraid we will get a lot of support tickets if clients are not able to change their (main) menu.

haroldangenent commented 8 years ago

As mentioned above in the given options:

Dynamic menu's could always be created for projects with ACF or an ACF starter or library.

I'm not suggesting replacing highly dynamic menu's with static menu's.

haroldangenent commented 8 years ago

We should take 'current state' for the main navigation into account. Not sure how Timber\Menu handles this.