groupon / node-cached

A simple caching library for node.js, inspired by the Play cache API
BSD 3-Clause "New" or "Revised" License
94 stars 15 forks source link

How do I remove a value from cache? #25

Closed henrikekblad closed 8 years ago

henrikekblad commented 8 years ago

The documentation isn'r really clear on this...

Is it enough to do a  set(key, undefined) ?

jkrems commented 8 years ago

Had to double-check - the second sentence of the README is (emphasis mine):

The interface only exposes very limited functionality, there's no multi-get or deletion of cached data.

In other words: We haven't implemented any active removal of data from the cache, cached data can only be replaced or expire naturally. We generally use this library for read-through caching (or rather refresh-ahead caching (?)), so we rarely have a need for messing with the keys directly.

But I'd be happy to review a PR adding support for deletion.