ptarjan / node-cache

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

Does it auto clean #86

Closed puppetmaster3 closed 7 years ago

puppetmaster3 commented 7 years ago

It says it will clear cache on get.

So if I have a million things and never get, they stay in ram don't timeout?

dvidsilva commented 7 years ago

A value on a key will get removed if you try to access it after its expiration, or when it's expiration is reached. But if you set no expiration or set too many values it will eat your ram.

ptarjan commented 7 years ago

If you set a timeout for your keys, they will be purged from your RAM after that timeout value is hit. https://github.com/ptarjan/node-cache/blob/master/index.js#L34