kodeart /
koded
| 1 | <?php declare(strict_types=1); |
||
| 2 | |||
| 3 | namespace Koded\Framework\Middleware; |
||
| 4 | |||
| 5 | use Psr\Http\Message\{ResponseInterface, ServerRequestInterface}; |
||
| 6 | use Psr\Http\Server\{MiddlewareInterface, RequestHandlerInterface}; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control |
||
| 10 | */ |
||
| 11 | class NoCacheMiddleware implements MiddlewareInterface |
||
| 12 | { |
||
| 13 | public function process( |
||
| 14 | ServerRequestInterface $request, |
||
| 15 | RequestHandlerInterface $handler): ResponseInterface |
||
| 16 | { |
||
| 17 | return $handler->handle($request) |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 18 | ->withHeader('Cache-Control', 'no-cache, max-age=0'); |
||
| 19 | } |
||
| 20 | } |
||
| 21 |