How to clear Route Caching on server: Laravel 5.2.37

后端 未结 4 722
春和景丽
春和景丽 2020-12-08 02:09

This is regarding route cache on localhost

About Localhost

I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning

4条回答
  •  北海茫月
    2020-12-08 03:02

    For your case solution is :

    php artisan cache:clear
    php artisan route:cache
    

    Optimizing Route Loading is a must on production :

    If you are building a large application with many routes, you should make sure that you are running the route:cache Artisan command during your deployment process:

    php artisan route:cache
    

    This command reduces all of your route registrations into a single method call within a cached file, improving the performance of route registration when registering hundreds of routes.

    Since this feature uses PHP serialization, you may only cache the routes for applications that exclusively use controller based routes. PHP is not able to serialize Closures.

    Laravel 5 clear cache from route, view, config and all cache data from application

    I would like to share my experience and solution. when i was working on my laravel e commerce website with gitlab. I was fetching one issue suddenly my view cache with error during development. i did try lot to refresh and something other but i can't see any more change in my view, but at last I did resolve my problem using laravel command so, let's see i added several command for clear cache from view, route, config etc.

    Reoptimized class loader:

    php artisan optimize
    

    Clear Cache facade value:

    php artisan cache:clear
    

    Clear Route cache:

    php artisan route:cache
    

    Clear View cache:

    php artisan view:clear
    

    Clear Config cache:

    php artisan config:cache
    

提交回复
热议问题