Clone response before using when caching web page (#7498)
This commit is contained in:
parent
37136f5986
commit
156fc9ab20
1 changed files with 2 additions and 2 deletions
|
@ -30,8 +30,8 @@ self.addEventListener('fetch', function(event) {
|
|||
|
||||
event.respondWith(asyncResponse.then(response => {
|
||||
if (response.ok) {
|
||||
return asyncCache.then(cache => cache.put('/', response))
|
||||
.then(() => response.clone());
|
||||
return asyncCache.then(cache => cache.put('/', response.clone()))
|
||||
.then(() => response);
|
||||
}
|
||||
|
||||
throw null;
|
||||
|
|
Loading…
Reference in a new issue