mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[flutter_tools] switch cache mode to reload (#62076)
This commit is contained in:
parent
210f7680fc
commit
234d8fac4d
@ -413,8 +413,8 @@ const CORE = [
|
||||
self.addEventListener("install", (event) => {
|
||||
return event.waitUntil(
|
||||
caches.open(TEMP).then((cache) => {
|
||||
// Provide a no-cache param to ensure the latest version is downloaded.
|
||||
return cache.addAll(CORE.map((value) => new Request(value, {'cache': 'no-cache'})));
|
||||
// Provide a 'reload' param to ensure the latest version is downloaded.
|
||||
return cache.addAll(CORE.map((value) => new Request(value, {'cache': 'reload'})));
|
||||
})
|
||||
);
|
||||
});
|
||||
@ -497,7 +497,7 @@ self.addEventListener("fetch", (event) => {
|
||||
// Either respond with the cached resource, or perform a fetch and
|
||||
// lazily populate the cache. Ensure the resources are not cached
|
||||
// by the browser for longer than the service worker expects.
|
||||
var modifiedRequest = new Request(event.request, {'cache': 'no-cache'});
|
||||
var modifiedRequest = new Request(event.request, {'cache': 'reload'});
|
||||
return response || fetch(modifiedRequest).then((response) => {
|
||||
cache.put(event.request, response.clone());
|
||||
return response;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user