douzhan1238 2017-06-02 17:04
浏览 349

Laravel 5.4 api中间件缓存问题

I am using laravel 5.4 with api middleware.

api.php

Route::get('/testing',function(){
echo "foo";
});

once I hit my url say localhost/api/testing it prints "foo" but when I change the message to "bar" and again hit same url it prints "foo". Seems like my change didn't had any effect and may be some caching is being done. I tried using

php artisan cache:clear 

but then too no effect.But same code when I write in web middleware it works totally fine and change is being updated .Now I am confused should I use api middleware or change my code to web middleware Any help would be appreciated.

  • 写回答

2条回答 默认 最新

  • douzi4724 2017-06-02 17:29
    关注

    Just clear all cache from following artisan command:-

    php artisan optimize
    
    php artisan route:clear
    
    php artisan config:clear
    
    php artisan cache:clear
    
    php artisan view:clear
    
    评论

报告相同问题?