mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 10:05:56 +00:00
retire MIN_CACHE_FILE_SIZE
This commit is contained in:
@@ -1196,7 +1196,7 @@ class RSSUtils {
|
|||||||
if (!$cache->exists($local_filename)) {
|
if (!$cache->exists($local_filename)) {
|
||||||
$file_content = fetch_file_contents(array("url" => $src, "max_size" => MAX_CACHE_FILE_SIZE));
|
$file_content = fetch_file_contents(array("url" => $src, "max_size" => MAX_CACHE_FILE_SIZE));
|
||||||
|
|
||||||
if ($file_content && strlen($file_content) > MIN_CACHE_FILE_SIZE) {
|
if ($file_content) {
|
||||||
$cache->put($local_filename, $file_content);
|
$cache->put($local_filename, $file_content);
|
||||||
}
|
}
|
||||||
} else if (is_writable($local_filename)) {
|
} else if (is_writable($local_filename)) {
|
||||||
@@ -1230,7 +1230,7 @@ class RSSUtils {
|
|||||||
|
|
||||||
$file_content = fetch_file_contents(array("url" => $src, "max_size" => MAX_CACHE_FILE_SIZE));
|
$file_content = fetch_file_contents(array("url" => $src, "max_size" => MAX_CACHE_FILE_SIZE));
|
||||||
|
|
||||||
if ($file_content && strlen($file_content) > MIN_CACHE_FILE_SIZE) {
|
if ($file_content) {
|
||||||
$cache->put($local_filename, $file_content);
|
$cache->put($local_filename, $file_content);
|
||||||
}
|
}
|
||||||
} else if ($cache->isWritable($local_filename)) {
|
} else if ($cache->isWritable($local_filename)) {
|
||||||
|
|||||||
@@ -54,8 +54,6 @@
|
|||||||
// feed limit for one update batch
|
// feed limit for one update batch
|
||||||
define_default('DAEMON_SLEEP_INTERVAL', 120);
|
define_default('DAEMON_SLEEP_INTERVAL', 120);
|
||||||
// default sleep interval between feed updates (sec)
|
// default sleep interval between feed updates (sec)
|
||||||
define_default('MIN_CACHE_FILE_SIZE', 1024);
|
|
||||||
// do not cache files smaller than that (bytes)
|
|
||||||
define_default('MAX_CACHE_FILE_SIZE', 64*1024*1024);
|
define_default('MAX_CACHE_FILE_SIZE', 64*1024*1024);
|
||||||
// do not cache files larger than that (bytes)
|
// do not cache files larger than that (bytes)
|
||||||
define_default('MAX_DOWNLOAD_FILE_SIZE', 16*1024*1024);
|
define_default('MAX_DOWNLOAD_FILE_SIZE', 16*1024*1024);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class Af_Zz_ImgProxy extends Plugin {
|
|||||||
|
|
||||||
$disable_cache = $this->host->get($this, "disable_cache");
|
$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)) {
|
if ($this->cache->put($local_filename, $data)) {
|
||||||
header("Location: " . $this->cache->getUrl($local_filename));
|
header("Location: " . $this->cache->getUrl($local_filename));
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -141,13 +141,9 @@ class Cache_Starred_Images extends Plugin {
|
|||||||
|
|
||||||
$data = fetch_file_contents(["url" => $url, "max_size" => MAX_CACHE_FILE_SIZE]);
|
$data = fetch_file_contents(["url" => $url, "max_size" => MAX_CACHE_FILE_SIZE]);
|
||||||
|
|
||||||
if ($data) {
|
if ($data)
|
||||||
if (strlen($data) > MIN_CACHE_FILE_SIZE) {
|
return $this->cache->put($local_filename, $data);;
|
||||||
$this->cache->put($local_filename, $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
//Debug::log("cache_images: local file exists for $url", Debug::$LOG_VERBOSE);
|
//Debug::log("cache_images: local file exists for $url", Debug::$LOG_VERBOSE);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user