diff --git a/index.js b/index.js index 0c3ee66..ae44613 100644 --- a/index.js +++ b/index.js @@ -92,7 +92,8 @@ function requestAsEventEmitter(opts) { } } }; - opts.cache.set(key, value); + const ttl = response.cachePolicy.timeToLive(); + opts.cache.set(key, value, ttl); }); } else if (revalidateCache) { const key = cacheKey(opts);