From 6914ad1f741570b66580d2933e8e2118adb177b5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 14 Aug 2019 12:44:50 +0300 Subject: retire MIN_CACHE_FILE_SIZE --- plugins/af_zz_imgproxy/init.php | 2 +- plugins/cache_starred_images/init.php | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/af_zz_imgproxy/init.php b/plugins/af_zz_imgproxy/init.php index 3c9744666..ddc30936f 100755 --- a/plugins/af_zz_imgproxy/init.php +++ b/plugins/af_zz_imgproxy/init.php @@ -67,7 +67,7 @@ class Af_Zz_ImgProxy extends Plugin { $disable_cache = $this->host->get($this, "disable_cache"); - if (!$disable_cache && strlen($data) > MIN_CACHE_FILE_SIZE) { + if (!$disable_cache) { if ($this->cache->put($local_filename, $data)) { header("Location: " . $this->cache->getUrl($local_filename)); return; diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php index 967569543..d13b0a443 100755 --- a/plugins/cache_starred_images/init.php +++ b/plugins/cache_starred_images/init.php @@ -141,13 +141,9 @@ class Cache_Starred_Images extends Plugin { $data = fetch_file_contents(["url" => $url, "max_size" => MAX_CACHE_FILE_SIZE]); - if ($data) { - if (strlen($data) > MIN_CACHE_FILE_SIZE) { - $this->cache->put($local_filename, $data); - } + if ($data) + return $this->cache->put($local_filename, $data);; - return true; - } } else { //Debug::log("cache_images: local file exists for $url", Debug::$LOG_VERBOSE); -- cgit v1.2.3-54-g00ecf