Closed serpentblade closed 8 months ago
loadRoutesFrom
already checks for this. Please check the underlying code.
I see that loudRoutesFrom
does handle this check already. But that doesn't account for the fact that when routes are cached Routes::group(...)
is called only to have nothing happen.
If adding this code is not considered a valid solution, perhaps moving Route::groups(...)
into the routes file instead is more acceptable? Ultimately my aim here is to not have this code run at all if it is not required to run.
Thanks. I'll leave the decision with @taylorotwell but I don't feel this is necessary.
@driesvints @serpentblade will be better to move 'Route::group' inside routes
files for avoiding extra logic.
If routes are already cached, it is not necessary to re-register Horizon routes on every request.
I've found that many Laravel packages don't check for already cached routes and will needlessly re-register routes that already exist in the cache anyway. This reduces boot times in production by ~0.5 ms which adds up when applied to multiple other first-party Laravel packages.
I can open PRs in other projects if this is approved.