yii\filters\HttpCache::validateCache PHP Метод

validateCache() защищенный Метод

If both Last-Modified and ETag are null, returns false.
protected validateCache ( integer $lastModified, string $etag ) : boolean
$lastModified integer the calculated Last-Modified value in terms of a UNIX timestamp. If null, the Last-Modified header will not be validated.
$etag string the calculated ETag value. If null, the ETag header will not be validated.
Результат boolean whether the HTTP cache is still valid.
    protected function validateCache($lastModified, $etag)
    {
        if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
            // HTTP_IF_NONE_MATCH takes precedence over HTTP_IF_MODIFIED_SINCE
            // http://tools.ietf.org/html/rfc7232#section-3.3
            return $etag !== null && in_array($etag, Yii::$app->request->getETags(), true);
        } elseif (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
            return $lastModified !== null && @strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $lastModified;
        } else {
            return false;
        }
    }