bv-ui-core 2.9.3 → 2.9.6
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/bvFetch/index.js +4 -2
- package/package.json +1 -1
package/lib/bvFetch/index.js
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
/**
|
3
2
|
* @fileOverview
|
4
3
|
* Provides api response caching utilties
|
@@ -133,7 +132,10 @@ module.exports = function BvFetch ({ shouldCache, cacheName, cacheLimit }) {
|
|
133
132
|
.then((cache) => {
|
134
133
|
return cache.match(cacheKey)
|
135
134
|
.then((cachedResponse) => {
|
136
|
-
|
135
|
+
if (!cachedResponse) {
|
136
|
+
this.cachedUrls.delete(cacheKey)
|
137
|
+
return Promise.resolve(null);
|
138
|
+
}
|
137
139
|
const cachedTime = cachedResponse.headers.get('X-Bazaarvoice-Cached-Time');
|
138
140
|
const ttl = cachedResponse.headers.get('Cache-Control').match(/max-age=(\d+)/)[1];
|
139
141
|
const currentTimestamp = Date.now();
|