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

This commit is contained in:
Akihiko Odaki authored and Eugen Rochko committed 2018-05-29 00:43:47 +02:00
1 parent 03f4c214b4
commit d95642f6d9
4 files changed
+30 -3

No files matched your search

@@ -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) {