Cache media only when storage can be freed (#7547)
This commit is contained in:
1 parent
bcbb6aa46f
commit
4e1400cecb
2 files changed
+8
-6
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { freeStorage } from '../storage/modifier';
|
||||
import { freeStorage, storageFreeable } from '../storage/modifier';
|
||||
import './web_push_notifications';
|
||||
|
||||
function openSystemCache() {
|
||||
@@ -49,7 +49,7 @@ self.addEventListener('fetch', function(event) {
|
||||
|
||||
return response;
|
||||
}));
|
||||
} else if (process.env.CDN_HOST ? url.host === process.env.CDN_HOST : url.pathname.startsWith('/system/')) {
|
||||
} else if (storageFreeable && process.env.CDN_HOST ? url.host === process.env.CDN_HOST : url.pathname.startsWith('/system/')) {
|
||||
event.respondWith(openSystemCache().then(cache => {
|
||||
return cache.match(event.request.url).then(cached => {
|
||||
if (cached === undefined) {
|
||||
|
||||
Reference in new issue
Block a user