Route Caching in Laravel 5

Route caching is useful tool if you have hundreds of routes in your application. It can effect our sites request time reduce hundreds of milliseconds. In the larger scale of competition user response is everything. You might feel huge difference in the perceived quickness of your applications.

Route Cache :

This command will serializes the results of the application routes.php file. Working with route cache if you changing your routes, will not effect your application until you re-cache.  

php artisan route:cache

It may be pain if you use caching on testing server or local server. If you using closure function within routes,php file then this command will not work and throw exception.

Route Service Provider :

RouteServiceProviders will check if route cache exists, Decode and unserialized the RouteCollection instance which holds the set of routes.

Route Clear :

php artisan route:clear

Delete route cache from your application.

Something to say? Tell us in comment section.