]> BookStack Code Mirror - bookstack/blob - app/Http/Middleware/PreventResponseCaching.php
Comments: Added HTML filter test, fixed placeholder in dark mode
[bookstack] / app / Http / Middleware / PreventResponseCaching.php
1 <?php
2
3 namespace BookStack\Http\Middleware;
4
5 use Closure;
6 use Symfony\Component\HttpFoundation\Response;
7
8 class PreventResponseCaching
9 {
10     /**
11      * Handle an incoming request.
12      *
13      * @param \Illuminate\Http\Request $request
14      * @param \Closure                 $next
15      *
16      * @return mixed
17      */
18     public function handle($request, Closure $next)
19     {
20         /** @var Response $response */
21         $response = $next($request);
22
23         $response->headers->set('Cache-Control', 'no-cache, no-store, private');
24         $response->headers->set('Expires', 'Sun, 12 Jul 2015 19:01:00 GMT');
25
26         return $response;
27     }
28 }