summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-05-29 23:14:42 +0300
committerAndrew Dolgov <[email protected]>2017-05-29 23:14:42 +0300
commit6fd03996949f32f51bf5ba55bf50d10d1521f22d (patch)
treeff00bf86c8869d632557c4e20def2bb5720d42d1 /plugins
parent34a61a0c3c3d660145a11a9fd0aa3b517dc86180 (diff)
tunables:
* add CACHE_MAX_DAYS as a tunable generic expiry interval for various cached files * add some comments to tunables in functions.php * rename _MIN_CACHE_FILE_SIZE to MIN_CACHE_FILE_SIZE * respect MIN_CACHE_FILE_SIZE setting in a few more places where content is cached
Diffstat (limited to 'plugins')
-rw-r--r--plugins/af_zz_imgproxy/init.php2
-rw-r--r--plugins/cache_starred_images/init.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/plugins/af_zz_imgproxy/init.php b/plugins/af_zz_imgproxy/init.php
index 7de0c0229..870e12a08 100644
--- a/plugins/af_zz_imgproxy/init.php
+++ b/plugins/af_zz_imgproxy/init.php
@@ -69,7 +69,7 @@ class Af_Zz_ImgProxy extends Plugin {
$disable_cache = $this->host->get($this, "disable_cache");
- if (!$disable_cache) {
+ if (!$disable_cache && strlen($data) > MIN_CACHE_FILE_SIZE) {
if (file_put_contents($local_filename, $data)) {
$mimetype = mime_content_type($local_filename);
header("Content-type: $mimetype");
diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php
index 6c9e67b17..527e088d5 100644
--- a/plugins/cache_starred_images/init.php
+++ b/plugins/cache_starred_images/init.php
@@ -209,7 +209,7 @@ class Cache_Starred_Images extends Plugin implements IHandler {
if (!file_exists($local_filename)) {
$file_content = fetch_file_contents($src);
- if ($file_content && strlen($file_content) > 0) {
+ if ($file_content && strlen($file_content) > MIN_CACHE_FILE_SIZE) {
file_put_contents($local_filename, $file_content);
$success = true;
}