fix: write to cache only if data is was not cached, fix #3586 (#3588)

This commit is contained in:
Dag 2023-08-01 06:19:42 +02:00 committed by GitHub
parent 7e4807530e
commit 8e2353ad3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 2 deletions

View File

@ -432,8 +432,6 @@ function getSimpleHTMLDOMCached(
$content = $cache->loadData($timeout); $content = $cache->loadData($timeout);
if (!$content || Debug::isEnabled()) { if (!$content || Debug::isEnabled()) {
$content = getContents($url, $header ?? [], $opts ?? []); $content = getContents($url, $header ?? [], $opts ?? []);
}
if ($content) {
$cache->setScope('pages'); $cache->setScope('pages');
$cache->setKey([$url]); $cache->setKey([$url]);
$cache->saveData($content); $cache->saveData($content);