From 09465619e53c9c0a04ee73cecc3fc2d87ee74d55 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 28 Jan 2024 17:03:05 +0000 Subject: enable object cash by default, introduce system.cache_expire_days and default to 7, default system.default_expire_days to 30 and system.active_expire_days to 7 --- Zotlabs/Lib/ASCache.php | 2 +- Zotlabs/Lib/Activity.php | 2 ++ Zotlabs/Lib/ActivityStreams.php | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Lib') diff --git a/Zotlabs/Lib/ASCache.php b/Zotlabs/Lib/ASCache.php index 63bd73ea7..4904a1d8a 100644 --- a/Zotlabs/Lib/ASCache.php +++ b/Zotlabs/Lib/ASCache.php @@ -8,7 +8,7 @@ namespace Zotlabs\Lib; class ASCache { public static function isEnabled() { - return Config::Get('system', 'as_object_cache_enabled', false); + return Config::Get('system', 'as_object_cache_enabled', true); } public static function getAge() { diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index a225e551b..a6a194045 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -3084,9 +3084,11 @@ class Activity { while ($current_item['parent_mid'] !== $current_item['mid']) { $cached = ASCache::Get($current_item['parent_mid']); if ($cached) { + // logger('cached: ' . $current_item['parent_mid']); $n = unserialise($cached); } else { + // logger('fetching: ' . $current_item['parent_mid']); $n = self::fetch($current_item['parent_mid'], $channel); if (!$n) { break; diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php index 3749126d3..b37efdd26 100644 --- a/Zotlabs/Lib/ActivityStreams.php +++ b/Zotlabs/Lib/ActivityStreams.php @@ -405,9 +405,11 @@ class ActivityStreams { if ($this->is_url($x)) { $cached = ASCache::Get($x); if ($cached) { + // logger('AS cached: ' . $x); $y = unserialise($cached); } else { + // logger('AS fetching: ' . $x); $y = $this->fetch_property($x); if ($y) { ASCache::Set($x, serialise($y)); -- cgit v1.2.3