PHP Класс Webiny\Component\Http\Response\CacheControl

Наследование: use trait Webiny\Component\StdLib\StdObjectTrait
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( ) Base constructor.
getCacheControl ( ) : array Returns the current cache control headers as an array.
setAsCache ( DateTimeObject $expirationDate ) Populates the cache control headers with options so that the browser caches the content.
setAsDontCache ( ) Populates the current cache control headers with options so the content is not cached by the browser.
setCacheControl ( array $cacheControl ) Overwrites the current cache control headers.
setCacheControlEntry ( string $key, string $value ) Sets or adds an entry to cache control headers.

Приватные методы

Метод Описание
validateCacheControlHeader ( string $header ) : boolean Checks if the give header name is a valid cache control header.

Описание методов

__construct() публичный Метод

Base constructor.
public __construct ( )

getCacheControl() публичный Метод

Returns the current cache control headers as an array.
public getCacheControl ( ) : array
Результат array

setAsCache() публичный Метод

Populates the cache control headers with options so that the browser caches the content.
public setAsCache ( DateTimeObject $expirationDate )
$expirationDate Webiny\Component\StdLib\StdObject\DateTimeObject\DateTimeObject Defines the date when the cache should expire.

setAsDontCache() публичный Метод

These headers are returned with each response by default.
public setAsDontCache ( )

setCacheControl() публичный Метод

Overwrites the current cache control headers.
public setCacheControl ( array $cacheControl )
$cacheControl array Array containing new cache control headers.

setCacheControlEntry() публичный Метод

Sets or adds an entry to cache control headers.
public setCacheControlEntry ( string $key, string $value )
$key string Cache control header name.
$value string Cache control header value.