Always assume the cache file is fresh when loading a package again which was already loaded, even if it lacks a last-modified header.
parent
9516d0dc98
commit
cb3c71a18a
|
@ -568,13 +568,12 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
|
||||||
} elseif ($useLastModifiedCheck) {
|
} elseif ($useLastModifiedCheck) {
|
||||||
if ($contents = $this->cache->read($cacheKey)) {
|
if ($contents = $this->cache->read($cacheKey)) {
|
||||||
$contents = json_decode($contents, true);
|
$contents = json_decode($contents, true);
|
||||||
if (isset($contents['last-modified'])) {
|
// we already loaded some packages from this file, so assume it is fresh and avoid fetching it again
|
||||||
if (isset($alreadyLoaded[$name])) {
|
if (isset($alreadyLoaded[$name])) {
|
||||||
$packages = $contents;
|
$packages = $contents;
|
||||||
} else {
|
} elseif (isset($contents['last-modified'])) {
|
||||||
$response = $this->fetchFileIfLastModified($url, $cacheKey, $contents['last-modified']);
|
$response = $this->fetchFileIfLastModified($url, $cacheKey, $contents['last-modified']);
|
||||||
$packages = true === $response ? $contents : $response;
|
$packages = true === $response ? $contents : $response;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue