diff --git a/src/util/tile_request_cache.js b/src/util/tile_request_cache.js index 172d8adf1b0..6bd8145c310 100644 --- a/src/util/tile_request_cache.js +++ b/src/util/tile_request_cache.js @@ -1,6 +1,6 @@ // @flow -import {parseCacheControl} from './util'; +import {warnOnce, parseCacheControl} from './util'; import window from './window'; import type Dispatcher from './dispatcher'; @@ -60,7 +60,9 @@ export function cachePut(request: Request, response: Response, requestTime: numb prepareBody(response, body => { const clonedResponse = new window.Response(body, options); - window.caches.open(CACHE_NAME).then(cache => cache.put(stripQueryParameters(request.url), clonedResponse)); + window.caches.open(CACHE_NAME) + .catch(e => warnOnce(e.message)) + .then(cache => cache.put(stripQueryParameters(request.url), clonedResponse)); }); }