From 7fb112cf42fbdaec10ce31845bf1158892387d9b Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Fri, 19 Aug 2016 08:34:45 -0700 Subject: [PATCH] Renamed cache storages --- server/static/service-worker.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/static/service-worker.js b/server/static/service-worker.js index 7b835e759..2adf7d2b7 100644 --- a/server/static/service-worker.js +++ b/server/static/service-worker.js @@ -53,9 +53,17 @@ Cache.prototype.addAll||(Cache.prototype.addAll=function(t){function e(t){this.n 'use strict'; // Assets - global.toolbox.router.get(/\/static\//, global.toolbox.cacheFirst); + global.toolbox.router.get(/\/static\//, global.toolbox.cacheFirst, { cache: { name: 'static' } }); global.toolbox.router.get('/(.*)', global.toolbox.fastest, {origin: 'https://secure.gravatar.com'}); + // API + global.toolbox.router.get(/\/api\//, global.toolbox.networkFirst, { + cache: { + name: 'api', + maxEntries: 100 + } + }); + // API GET calls global.toolbox.router.default = global.toolbox.networkFirst;