b13 / menus

TYPO3 Extension for creating fast menus in a fast fashion
GNU General Public License v2.0
54 stars 21 forks source link

Increase usage of the internal menu cache #78

Closed lochmueller closed 1 year ago

lochmueller commented 1 year ago

Hey @bmack

we have a very large site incl. a "Mega Navigation" (multiple layer and also images etc.). In the backend I also use this workaround https://github.com/b13/menus/issues/51 , but we need more speed in the generation process. The current tree compile calculate the tree and cache this, but the fluid template still use 30-40% of the rendering time in frontend on every page (many page link, image viewhelper, reselction etc.).

So the idea was born, that we enrich the "populateAdditionalKeysForPage" function and precalculate more information for a page. The compiler use also the rendered language in the cache identifier, so it is possible to calculate images, links etc. in this function. The template is only the "output helper" and there is no or anymore. This speed up the generation of next request because all menu information are already part of the cache.

What are your thoughts? Perhaps a PSR Event in populateAdditionalKeysForPage is useful in the future?

Regards, Tim

lochmueller commented 1 year ago

Hey @bmack ,

I add the basic idea to https://github.com/lochmueller/menus/commit/339d81dac53aa0cba55cd8f9ab0fbf021267b788 and this branch: https://github.com/lochmueller/menus/commits/menu-repository-event

Problem will be, that v9 is still supported (and do not support PSR-14 events). Any plans to drop support for old TYPO3 & PHP?

Regards, Tim

achimfritz commented 1 year ago

Hi @lochmueller , yes, we are currently working on Release 1.0 and drop v9 (also proper DI will be used)