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

        }
    }
}

exports._openCache = function(cacheName) {
    return function() {
12
        return window.caches.open(cacheName);
13 14 15
    }
}

16 17 18 19 20 21 22
exports._delete = function(cacheName) {
    return function() {
        return caches.delete(cacheName);
    }
}

exports._deleteReq = function(cache) {
23
    return function(req) {
24
        return function() {
25
            return cache.delete(req);
26 27 28
        }
    }
}
29

30 31 32 33
exports._add = function(cache) {
    return function(req) {
        return function() {
            return cache.add(req);
34 35 36 37
        }
    }
}

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

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