ptarjan / node-cache

A simple in-memory cache for nodejs
BSD 2-Clause "Simplified" License
1.59k stars 214 forks source link

expire property necessary? #74

Open edvardchen opened 8 years ago

edvardchen commented 8 years ago

Since we have kept reference of timeout handle, is it necessary to add expire as a property and check it every time we call get method? Is not obvious that it exists means it is not expired? Any other uses ?

karladler commented 7 years ago

I would like to have the option to set TTL without adding a timeout function. So the cache invalidation is handled on the next get request. For that kind of purpose the expiration field would be very useful, but for now I also don't see the purpose for that, except for debugging.