Skip to content

Use route cache to store breadcrumb lists to speed things up

Compare
Choose a tag to compare
@thormeier thormeier released this 19 Nov 10:34
· 31 commits to master since this release

This version uses the route cache to not load all routes on every request:

  • On cache:warmup all breadcrumb lists for all routes are stored in the route cache.

  • This speeds up the whole process of breadcrumb building since the getting of the whole RouteCollection triggers the router to reload all routes from filesystem every time.

  • Breadcrumb config is ultimately stored in _breadcrumbs in a routes defaults. This, because options do not get cached.

  • It uses a custom routing loader and replaces the existing routing.loader service by aliasing thormeier_breadcrumb.routing.attach_breadcrumb_loader via compiler pass.

    If you are already replacing/extending the routing.loader service, use a compiler pass as well to make this work smooth!