CacheControlDirectives
class CacheControlDirectives (View source)
Cache-Control HTTP header generation/parsing
Properties
protected array | $cacheDirectives |
Methods
Internally sets the cache directives correctly by parsing the given Cache-Control header value.
Sets a special directive for use in the Cache-Control header, according to RFC 2616 / 14.9
Removes a special directive previously set for the Cache-Control header.
Returns the value of the specified Cache-Control directive.
No description
Renders and returns a Cache-Control header value, based on the previously set cache control directives.
Details
static CacheControlDirectives
fromRawHeader(string $rawHeaderValue)
Internally sets the cache directives correctly by parsing the given Cache-Control header value.
void
setDirective(string $name, string|null $value = null)
Sets a special directive for use in the Cache-Control header, according to RFC 2616 / 14.9
void
removeDirective(string $name)
Removes a special directive previously set for the Cache-Control header.
mixed
getDirective(string $name)
Returns the value of the specified Cache-Control directive.
If the cache directive is not present, NULL is returned. If the specified directive is present but contains no value, this method returns true. Finally, if the directive is present and does contain a value, the value is returned.
array
getDirectives()
No description
string|null
getCacheControlHeaderValue()
Renders and returns a Cache-Control header value, based on the previously set cache control directives.