0 follower

Final Class Yiisoft\HttpMiddleware\HttpCache\CacheControlProvider\ConstantCacheControlProvider

InheritanceYiisoft\HttpMiddleware\HttpCache\CacheControlProvider\ConstantCacheControlProvider
ImplementsYiisoft\HttpMiddleware\HttpCache\CacheControlProvider\CacheControlProviderInterface

Returns a predefined cache control header value regardless of request.

Constants

Hide inherited constants

Constant Value Description Defined By
DEFAULT_VALUE 'public, max-age=3600' Yiisoft\HttpMiddleware\HttpCache\CacheControlProvider\ConstantCacheControlProvider

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( string $value self::DEFAULT_VALUE )
$value string

The cache control header value to return.

                public function __construct(
    private readonly string $value = self::DEFAULT_VALUE,
) {
}

            
get() public method

public string|null get ( \Psr\Http\Message\ServerRequestInterface $request )
$request \Psr\Http\Message\ServerRequestInterface

                public function get(ServerRequestInterface $request): ?string
{
    return $this->value;
}