const CACHE_NAME = 'app_core_cache_v' + version;

const criticalResources = [
    '/dist/bundle.js',
    '/'
];

cacheCriticals = () => {
    return caches.open(CACHE_NAME).then(cache => {
        return cache.addAll(criticalResources);
    });
};

self.addEventListener('install', function (event) {
    event.waitUntil(cacheCriticals().then(() => self.skipWaiting()));
});

self.addEventListener('fetch', function (event) {
    function proxy() {
        return caches.match(event.request).then(function (cachedResponse) {
            return cachedResponse || fetch(event.request);
        })
    }

    event.respondWith(proxy());
});

@@ -1,54 +1,4 @@
-const CACHE_NAME = 'app_core_cache_v' + version;%0A%0A
 cons
@@ -44,16 +44,62 @@
 le.js',%0A
+    '/db/tags.json',%0A    '/db/problems.json',%0A
     '/'%0A
@@ -530,52 +530,406 @@
     
-return cachedResponse %7C%7C fetch(event.request
+if (!event.request.url.startsWith('/db/')) %7B%0A                return cachedResponse %7C%7C fetch(event.request);%0A            %7D%0A%0A            return new Promise(resolve =%3E %7B%0A                fetch(event.request)%0A                    .then(response =%3E resolve(response))%0A                    .catch(e =%3E resolve(cachedResponse));%0A%0A                setTimeout(() =%3E resolve(cachedResponse), 3000);%0A            %7D
 );%0A 

update sw