apigee-127 / volos

Key Node.js modules for building production-quality APIs
Other
205 stars 63 forks source link

Support no ttl default set for volos cache #40

Open kevinprotoss opened 10 years ago

kevinprotoss commented 10 years ago

Hello,

As is known to us, redis cache is able to act as a LRU cache when no ttl is set. This means the key-value pair will be cached based on LRU strategy and they will not be invalidated even the ttl is expired.

However, the ttl of volos cache interface is set by default value 300 ms. For the memory cache, it has not such configuration for sure. Is it possible to extend volos cache for supporting this feature as well?

Bg, Kevin

theganyo commented 10 years ago

Hi Kevin. I can look into this, but have you considered just setting a high timeout?

kevinprotoss commented 10 years ago

Yes, I have considered that. In the end, I found it's more useful if the cache can persist in the redis according to LRU. Only those which are not used recently will be deleted if the maximum memory limit has been reached.

To be simple, you can define an option of cache interface for disabling ttl, can't you

Bg, Kevin

theganyo commented 10 years ago

My concern is ensuring we can support the same semantics for TTL and size cap across all providers. That said, yes, I believe we can do this.