<?php

namespace App\Http\Middleware;

use Closure;

final class NoStore
{
    public function handle($request, Closure $next)
    {
        $response = $next($request);

        // Symfony Response 계열은 headers bag 사용
        $response->headers->set('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0');
        $response->headers->set('Pragma', 'no-cache');
        $response->headers->set('Expires', '0');

        return $response;
    }
}
