1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { getOrCreatePrecacheController } from './getOrCreatePrecacheController.js';
|
9 | import { generateURLVariations } from './generateURLVariations.js';
|
10 | import '../_version.js';
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | export const getCacheKeyForURL = (url, options) => {
|
23 | const precacheController = getOrCreatePrecacheController();
|
24 | const urlsToCacheKeys = precacheController.getURLsToCacheKeys();
|
25 | for (const possibleURL of generateURLVariations(url, options)) {
|
26 | const possibleCacheKey = urlsToCacheKeys.get(possibleURL);
|
27 | if (possibleCacheKey) {
|
28 | return possibleCacheKey;
|
29 | }
|
30 | }
|
31 | };
|