summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-08-16 09:40:59 +0300
committerAndrew Dolgov <[email protected]>2015-08-16 09:40:59 +0300
commit18433c6c1824aa46c8328925f15be95897acadd9 (patch)
tree21fd3b5309bd41059380b18500368d6b3b4d5dd0
parentabb2ead416e7e607249b70fd95df4333528e274d (diff)
parent4a27966e78407d4482de5d1a70093930f9eb8b85 (diff)
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
-rw-r--r--include/rssfuncs.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index a922516cd..7ea0bf0c8 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);
}
}
}