summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJustAMacUser <[email protected]>2015-08-14 19:49:41 -0400
committerJustAMacUser <[email protected]>2015-08-16 00:33:33 -0400
commit4a27966e78407d4482de5d1a70093930f9eb8b85 (patch)
tree9ca4a625d9f07fde244783d77a8ea3a1c4250d64 /include
parent98b0729850d36f07d12661d91b06b8057a4e3aed (diff)
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.
Diffstat (limited to 'include')
-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);
}
}
}