Skip to content

Instantly share code, notes, and snippets.

@filipbech
Last active March 15, 2018 10:49
Show Gist options
  • Save filipbech/2682f2793854e9bdf8de64765669aba2 to your computer and use it in GitHub Desktop.
Save filipbech/2682f2793854e9bdf8de64765669aba2 to your computer and use it in GitHub Desktop.
Caching ES modules
const moduleRequests = ['app.js', 'module1.js']
.map(url => new Request(url, {
mode: 'cors',
credentials: 'omit'
}));
cache.addAll([
'index.html',
...moduleRequests
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment