-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
Description
What do you think about returning the remaining TTL with the cache
object as well?
I need to be able to say "3 minutes old" or similar, so the user knows if they should force a refresh or not.
From what I can tell, the best way (that works across all stores) is to store the request payload with the TTL information (TTL + UNIX timestamp) so that it can be returned/calculated when retrieving from the cache:
https://github.com/matteoagosti/node-request-caching/blob/master/lib/store/redis.js#L41