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

Update docs or change default backend from "noop" #37

Closed emertechie closed 3 years ago

emertechie commented 7 years ago

Just started using library today (mainly the getOrElse fn) and couldn't figure out for ages why it kept calling my store and not caching things. I ended up having to dig through the code to eventually discover that the default backend is noop :/

You might want to update the first Usage example you show to call this out. Or, maybe even throw exception is you don't explicitly select a backend.

Thanks for the project

jkrems commented 7 years ago

Thanks! That's definitely a good point. Deprecating the noop default sounds like a pretty great idea. Not sure when I/we'd come around to it though. :( If you'd be interested, a PR would be appreciated!

aaarichter commented 3 years ago

@jkrems I'll remove noop in my major bump https://github.com/groupon/node-cached/pull/48