CacheHeadersCheck
class CacheHeadersCheck implements EnvironmentCheck (View source)
Check cache headers for any response, can specify directives that must be included and also must be excluded from Cache-Control headers in response. Also checks for existence of ETag.
Traits
Simple helper for env checks which require HTTP clients.
Properties
public | Client | $client | Client for making requests, set vi Injector. |
from Fetcher |
protected | string | $url | Absolute URL for requests. |
from Fetcher |
protected | array | $mustInclude | Settings that must be included in the Cache-Control header |
|
protected | array | $mustExclude | Settings that must be excluded in the Cache-Control header |
|
protected | ValidationResult | $result | Result to keep track of status and messages for all checks, reuses ValidationResult for convenience. |
Methods
Set up with URL, arrays of header settings to check.
Details
Fetcher
setURL(string $url)
Set URL for requests.
string
getURL()
Getter for URL
__construct(string $url = '', array $mustInclude = [], array $mustExclude = [])
Set up with URL, arrays of header settings to check.
array
check()
Check that correct caching headers are present.