mirror of
https://github.com/mrclay/minify.git
synced 2025-08-11 16:44:44 +02:00
ConditionalGet.php : comment clarification
This commit is contained in:
@@ -112,18 +112,18 @@ class HTTP_ConditionalGet {
|
|||||||
$_SERVER['REQUEST_TIME'] + $spec['maxAge']
|
$_SERVER['REQUEST_TIME'] + $spec['maxAge']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (isset($spec['lastModifiedTime'])) {
|
if (isset($spec['lastModifiedTime'])) {
|
||||||
$this->_setLastModified($spec['lastModifiedTime']);
|
$this->_setLastModified($spec['lastModifiedTime']);
|
||||||
if (isset($spec['eTag'])) { // Use it
|
if (isset($spec['eTag'])) { // Use it
|
||||||
$this->_setEtag($spec['eTag'], $scope);
|
$this->_setEtag($spec['eTag'], $scope);
|
||||||
} else { // base both headers on time
|
} else { // base both headers on time
|
||||||
$this->_setEtag($spec['lastModifiedTime'], $scope);
|
$this->_setEtag($spec['lastModifiedTime'], $scope);
|
||||||
}
|
}
|
||||||
} elseif (isset($spec['eTag'])) { // Use it
|
} elseif (isset($spec['eTag'])) { // Use it
|
||||||
$this->_setEtag($spec['eTag'], $scope);
|
$this->_setEtag($spec['eTag'], $scope);
|
||||||
} elseif (isset($spec['contentHash'])) { // Use the hash as the ETag
|
} elseif (isset($spec['contentHash'])) { // Use the hash as the ETag
|
||||||
$this->_setEtag($spec['contentHash'], $scope);
|
$this->_setEtag($spec['contentHash'], $scope);
|
||||||
}
|
}
|
||||||
$this->_headers['Cache-Control'] = "max-age={$maxAge}, {$scope}, must-revalidate";
|
$this->_headers['Cache-Control'] = "max-age={$maxAge}, {$scope}, must-revalidate";
|
||||||
// invalidate cache if disabled, otherwise check
|
// invalidate cache if disabled, otherwise check
|
||||||
$this->cacheIsValid = (isset($spec['invalidate']) && $spec['invalidate'])
|
$this->cacheIsValid = (isset($spec['invalidate']) && $spec['invalidate'])
|
||||||
@@ -226,7 +226,7 @@ class HTTP_ConditionalGet {
|
|||||||
{
|
{
|
||||||
if (null === $this->_etag) {
|
if (null === $this->_etag) {
|
||||||
// lmTime is copied to ETag, so this condition implies that the
|
// lmTime is copied to ETag, so this condition implies that the
|
||||||
// client received neither ETag nor Last-Modified, so can't
|
// server sent neither ETag nor Last-Modified, so the client can't
|
||||||
// possibly has a valid cache.
|
// possibly has a valid cache.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user