CacheAPI.js 888 Bytes
Newer Older
1 2 3
exports._makeRequest = function(url) {
    return function(options) {
        return new Request(url, options);
4 5 6 7 8
    }
}

exports._openCache = function(cacheName) {
    return function() {
9
        return window.caches.open(cacheName);
10 11 12
    }
}

13 14 15 16 17 18 19
exports._delete = function(cacheName) {
    return function() {
        return caches.delete(cacheName);
    }
}

exports._deleteReq = function(cache) {
20
    return function(req) {
21
        return function() {
22
            return cache.delete(req);
23 24 25
        }
    }
}
26

27 28 29 30
exports._add = function(cache) {
    return function(req) {
        return function() {
            return cache.add(req);
31 32 33 34
        }
    }
}

35
exports._match = function(cache) {
36 37
    return function(req) {
        return function() {
38
            return cache.match(req);
39 40 41
        }
    }
}
42 43 44 45 46 47

exports._fetch = function(req) {
    return function() {
        return fetch(req);
    }
}