From: JustAMacUser Date: Fri, 14 Aug 2015 23:49:41 +0000 (-0400) Subject: Keep local cached images fresh if file exists. X-Git-Tag: 16.3~129^2^2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4a27966e78407d4482de5d1a70093930f9eb8b85;p=tt-rss.git 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. --- diff --git a/include/rssfuncs.php b/include/rssfuncs.php index a922516c..7ea0bf0c 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -1248,6 +1248,8 @@ if ($file_content && strlen($file_content) > _MIN_CACHE_IMAGE_SIZE) { file_put_contents($local_filename, $file_content); } + } else { + touch($local_filename); } } }