Route Caching
To know more about creating resource controller visit our Bajarangisoft site.
Closure based routes cannot be cached. To use route caching, you must convert any Closure routes to controller classes.
If your application is exclusively using controller based routes, you should take advantage of Laravel's route cache. Using the route cache will drastically decrease the amount of time it takes to register all of your application's routes. In some cases, your route registration may even be up to 100x faster. To generate a route cache, just execute the route:cache
Artisan command:
php artisan route:cache
After running this command, your cached routes file will be loaded on every request. Remember, if you add any new routes you will need to generate a fresh route cache. Because of this, you should only run the route:cache
command during your project's deployment.
route:clear
command to clear the route cache:
php artisan route:clear