Skip to content

Instantly share code, notes, and snippets.

@jimrubenstein
Created March 12, 2015 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimrubenstein/731b45f54a341ff712e5 to your computer and use it in GitHub Desktop.
Save jimrubenstein/731b45f54a341ff712e5 to your computer and use it in GitHub Desktop.
<?php namespace App\Http\Middleware;
use Closure;
class NoCache {
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$response = $next($request);
$response->header("Pragma", "no-cache");
$response->header("Cache-Control", "no-store, no-cache, must-revalidate, max-age=0");
return $response;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment