Closed ghost closed 7 years ago
Whats about adding an Option for Custom Cache Keys?
if(options.customkey) { key = options.customkey; } else { key = JSON.stringify(this.normalizeOptions(options)); key = this.hashKey(key); }
You can have custom keys by overwriting CachedRequest#hashKey.
CachedRequest#hashKey
const cr = require('cached-request')(request) cr.hashKey = (stringifiedOptions) => { // return a string }
Whats about adding an Option for Custom Cache Keys?