Laravel 4 not refreshing

后端 未结 5 909
温柔的废话
温柔的废话 2021-01-07 00:16

I have a strange issue in laravel 4 as each time I try to refresh the page changes doesn\'t appear . For sure it\'s not browser\'s cache . Any help appretiated

5条回答
  •  余生分开走
    2021-01-07 00:53

    I had a similar problem with the back-button, finally i noticed, that in my Laravel project no Cache-Control header was sent. The browser decided to cache this page and didn't do a new request.

    To send this header, you can modify the app/filters.php file like this:

    App::after(function($request, $response)
    {
      $response->headers->set('Cache-Control', 'no-store, no-cache, must-revalidate');
      $response->headers->set('Pragma', 'no-cache');
    }
    

提交回复
热议问题