Cake\Network\Response::mustRevalidate PHP Method

mustRevalidate() public method

must-revalidate indicates that the response should not be served stale by a cache under any circumstance without first revalidating with the origin. If called with no parameters, this function will return whether must-revalidate is present.
public mustRevalidate ( boolean | null $enable = null ) : boolean
$enable boolean | null if null, the method will return the current must-revalidate value. If boolean sets or unsets the directive.
return boolean
    public function mustRevalidate($enable = null)
    {
        if ($enable !== null) {
            if ($enable) {
                $this->_cacheDirectives['must-revalidate'] = true;
            } else {
                unset($this->_cacheDirectives['must-revalidate']);
            }
            $this->_setCacheControl();
        }
        return array_key_exists('must-revalidate', $this->_cacheDirectives);
    }