Advertisement
julong

fixed bt-back-no-cache

Mar 23rd, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. In routes:
  2.  
  3. Route::group(array('before' => 'auth', 'after' => 'no-cache'), function()
  4. {
  5. Route::get('dashboard', array('as' => 'getDashboard', 'uses' => 'DashboardController@getIndex'));
  6.  
  7. Route::get('logout', array('as' => 'getLogout', 'uses' => 'LoginController@getLogout'));
  8.  
  9. Route::group(array('prefix' => 'users'), function()
  10. {
  11. Route::get('users', array('as' => 'getUsers', 'uses' => 'UsersController@getIndex', 'before' => 'hasAccess:users.index'));
  12. });
  13. });
  14. In filters:
  15.  
  16. Route::filter('no-cache',function($route, $request, $response){
  17.  
  18. $response->headers->set('Cache-Control','nocache, no-store, max-age=0, must-revalidate');
  19. $response->headers->set('Pragma','no-cache');
  20. $response->headers->set('Expires','Fri, 01 Jan 1990 00:00:00 GMT');
  21.  
  22. });
  23.  
  24.  
  25. another way:
  26. http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement