thormeier/breadcrumb-bundle

performance: use the cached routes?

Closed this issue · 5 comments

dbu commented

this line triggers loading all routes on each request: https://github.com/thormeier/breadcrumb-bundle/blob/master/Provider/BreadcrumbProvider.php#L74

we should try to see if we can get that information from the route cache instead, to improve performance.

Sounds reasonable. Perhaps build a breadcrumb cache as well?

dbu commented

@dbu After some discussion with @Tobion, I made a few changes so it now uses the cache warmup to save raw breadcrumb info to the routing cache. Now the current tree will be available in $request->get('_breadcrumbs'), which doesn't cause the whole routing to get reloaded on every request.

Commit is 45dbe14

Would be awesome if this could be tested, so we can release 2.1.0, since there are no BC breaks in this one.

@dbu @Tobion: Thank you very much for reviewing! Refactored it to use a compiler pass instead and fixed other stuff mentioned. Current commit is 658d6a3

dbu commented

yay!