freescout/freescout-dist/app/Http/Middleware/ResponseHeaders.php

22 lines
446 B
PHP
Raw Permalink Normal View History

2023-12-22 19:40:32 +00:00
<?php
namespace App\Http\Middleware;
use Closure;
class ResponseHeaders
{
public function handle($request, Closure $next)
{
$response = $next($request);
// Disable caching
if (method_exists($response, 'header')) {
$response->header('Pragma', 'no-cache');
$response->header('Cache-Control', 'no-cache, max-age=0, must-revalidate, no-store');
}
return $response;
}
}