node-request-caching
node-request-caching copied to clipboard
A way to force a new fetch but still preserving the TTL to store the newly fetched data.
I've got a situation where sometimes the GET request returns successful but the data is empty. This means subsequent requests return a cached empty object.
I can force a re-GET by setting the options.caching.ttl = 0 however, from what I could tell in the code, this also means the results will not be stored.
I'd like a way to force a new fetch to be made, regardless of the TTL on the existing cache, and when the request is complete, store it as normal with the normal TTL already set.
Is there an existing way to do this, am I going about it wrong, or do you agree this would be a useful feature? (If you agree, then I am willing to submit a pull request, just wanted to make sure it was necessary first).