mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-14 11:05:56 +00:00
Merge branch 'keep-cached-images-fresh' into 'master'
Keep local cached images fresh if file exists. Updates the cache_images() function to `touch` images if the file exists already. Some sites (e.g. news) re-use stock images and this change updates the local file's modified time every time the image is referenced in new articles. This should prevent the local file from being expired/deleted only to be re-cached later on. See merge request !9
This commit is contained in:
@@ -1248,6 +1248,8 @@
|
|||||||
if ($file_content && strlen($file_content) > _MIN_CACHE_IMAGE_SIZE) {
|
if ($file_content && strlen($file_content) > _MIN_CACHE_IMAGE_SIZE) {
|
||||||
file_put_contents($local_filename, $file_content);
|
file_put_contents($local_filename, $file_content);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
touch($local_filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user