if we don't store something like cacheEOL or storedAt timestamp, then we have no way to, "[respect] the TTL value"
this is the current flow:
requesting record for the first time
check if this.localStore has record // NO
query network for the record.
validate that record is correct
store record in cache (has ttl)
return record to user
later requests for record (with default nocache=undefined)
check if this.localStore has record // yes
return cached record
we essentially need a check between 1 & 2 of later requests for record that will check if the record is expired.. unless this.localStore is already handling expiry, but it doesn't seem like it is:
we have no calls to remove, and localStore doesn't have any methods other than put/get/has, and nothing called on the datastore (given in localStore creation) other than put/get/has
need to resolve https://github.com/ipfs/helia/pull/473#discussion_r1541949303. Summary of comment below:
if we don't store something like
cacheEOL
orstoredAt
timestamp, then we have no way to, "[respect] the TTL value"this is the current flow:
requesting record for the first time
later requests for record (with default nocache=undefined)
we essentially need a check between 1 & 2 of
later requests for record
that will check if the record is expired.. unless this.localStore is already handling expiry, but it doesn't seem like it is:we have no calls to
remove
, and localStore doesn't have any methods other thanput
/get
/has
, and nothing called on the datastore (given in localStore creation) other thanput
/get
/has