0
0
Fork 0

Cache attachments on external host with service worker (#7493)

This commit is contained in:
Akihiko Odaki 2018-05-29 07:43:47 +09:00 committed by Eugen Rochko
parent 03f4c214b4
commit d95642f6d9
4 changed files with 30 additions and 3 deletions

View file

@ -49,7 +49,7 @@ self.addEventListener('fetch', function(event) {
return response;
}));
} else if (storageFreeable && process.env.CDN_HOST ? url.host === process.env.CDN_HOST : url.pathname.startsWith('/system/')) {
} else if (storageFreeable && (ATTACHMENT_HOST ? url.host === ATTACHMENT_HOST : url.pathname.startsWith('/system/'))) {
event.respondWith(openSystemCache().then(cache => {
return cache.match(event.request.url).then(cached => {
if (cached === undefined) {