diff --git a/includes/class-tmdo-hivepress-transient-filter.php b/includes/class-tmdo-hivepress-transient-filter.php index 85a681a..c5a0f44 100644 --- a/includes/class-tmdo-hivepress-transient-filter.php +++ b/includes/class-tmdo-hivepress-transient-filter.php @@ -80,8 +80,8 @@ final class TMDO_Hivepress_Transient_Filter { /** Object cache group used instead of wp_options when a persistent cache is present. */ public const CACHE_GROUP = 'tmdo_hp_transient'; - /** Longest an object-cache entry lives: a week (HivePress's default is a day). */ - public const MAX_CACHE_TTL = 604800; + /** Longest an object-cache entry lives: a day, HivePress's own default (2.4 PR-120). */ + public const MAX_CACHE_TTL = DAY_IN_SECONDS; /** * Register the four metadata filters on `init`. Idempotent — safe to call diff --git a/tests/integration/HivepressTransientFilterTest.php b/tests/integration/HivepressTransientFilterTest.php index ada423f..92fae91 100644 --- a/tests/integration/HivepressTransientFilterTest.php +++ b/tests/integration/HivepressTransientFilterTest.php @@ -215,11 +215,14 @@ class HivepressTransientFilterTest extends TestCase { /** * Entries expire in the object cache too (2.3 PR-099): the value (written - * first, before its timeout is known) after a week, the timeout after the + * first, before its timeout is known) after a day, the timeout after the * later of that and its own time, plus a minute. Orphans of deleted posts * no longer pile up. */ public function test_with_an_object_cache_entries_get_a_ttl(): void { + // A day, HivePress's own default: at a week, 1.3M listings kept 4.7M + // entries (1 GB) in a shared Redis and pushed other sites' keys out (2.4 PR-120). + $this->assertSame( 86400, WPDO_Hivepress_Transient_Filter::MAX_CACHE_TTL ); $GLOBALS['_wp_using_ext_object_cache'] = true; $key = '_transient_hp_models/cat/v1'; $translated = WPDO_Hivepress_Transient_Filter::translate_key( 100, $key );