NoHttpCache   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 21
c 1
b 0
f 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 12 1
1
<?php
2
3
namespace Wingsline\Blog\Http\Middleware;
4
5
use Closure;
6
7
class NoHttpCache
8
{
9
    /**
10
     * Handle an incoming request.
11
     *
12
     * @param \Illuminate\Http\Request $request
13
     *
14
     * @return mixed
15
     */
16
    public function handle($request, Closure $next)
17
    {
18
        $response = $next($request);
19
20
        $response->header('Pragma', 'no-cache');
21
        $response->header('Expires', 'Fri, 01 Jan 1990 00:00:00 GMT');
22
        $response->header(
23
            'Cache-Control',
24
            'no-cache, must-revalidate, no-store, max-age=0, private'
25
        );
26
27
        return $response;
28
    }
29
}
30