From dc5e65f1c2dbde2c39e7cde8b743c277157f01ff Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Tue, 27 Aug 2024 18:39:33 -0400 Subject: [PATCH] increase TTL of values that do not change in the DwnDataStore implementation --- packages/agent/src/store-data.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/agent/src/store-data.ts b/packages/agent/src/store-data.ts index 6873eaa0e..cc99ea5aa 100644 --- a/packages/agent/src/store-data.ts +++ b/packages/agent/src/store-data.ts @@ -55,16 +55,19 @@ export class DwnDataStore = Jwk> implem /** * Index for mappings from Store Identifier to DWN record ID. + * Since these values don't change, we can use a long TTL. * - * Up to 1,000 entries are retained for 2 hours. + * Up to 1,000 entries are retained for 30 days. */ - protected _index = new TtlCache({ ttl: ms('2 hours'), max: 1000 }); + protected _index = new TtlCache({ ttl: ms('30 days'), max: 1000 }); /** * Cache of tenant DIDs that have been initialized with the protocol. * This is used to avoid redundant protocol initialization requests. + * + * Since these are default protocols and unlikely to change, we can use a long TTL. */ - protected _protocolInitializedCache: TtlCache = new TtlCache({ ttl: ms('1 hour'), max: 1000 }); + protected _protocolInitializedCache: TtlCache = new TtlCache({ ttl: ms('30 days'), max: 1000 }); /** * The protocol assigned to this storage instance.