BookStack/app/Http/Middleware/PreventResponseCaching.php

29 lines
644 B
PHP
Raw Normal View History

<?php
namespace BookStack\Http\Middleware;
use Closure;
use Symfony\Component\HttpFoundation\Response;
class PreventResponseCaching
{
/**
* Handle an incoming request.
*
2021-10-09 05:23:17 +08:00
* @param \Illuminate\Http\Request $request
* @param \Closure $next
*
* @return mixed
*/
public function handle($request, Closure $next)
{
/** @var Response $response */
$response = $next($request);
$response->headers->set('Cache-Control', 'no-cache, no-store, private');
$response->headers->set('Expires', 'Sun, 12 Jul 2015 19:01:00 GMT');
return $response;
}
}