1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
module.exports = class KVCache { get(key) { return WORKERS_GRAPHQL_CACHE.get(key); } set(key, value, options) { const opts = {}; const ttl = options && options.ttl; if (ttl) { opts.expirationTtl = ttl; } return WORKERS_GRAPHQL_CACHE.put(key, value, opts); } };