AlbinoDrought / cachios

Simple axios cache wrapper using node-cache
MIT License
88 stars 10 forks source link

[ #61 ] Support async cache repositories like `keyv` #62

Closed AlbinoDrought closed 3 years ago

AlbinoDrought commented 3 years ago

Releasing this as 3.0.0, could be a breaking change for people that depend on modified behaviour of getCachedValue or setCachedValue in their project. Here's an example of code that would now have different behaviour:

const cachios = require('cachios');
const myCustomCache = {};
cachios.getCachedValue = (key) => Promise.resolve(myCustomCache[key]);

Before 3.0, this example could return undefined if key did not exist in myCustomCache.

After 3.0, this example would cause a fresh request to be sent.