|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | Copyright 2019 Google LLC
|
|---|
| 3 |
|
|---|
| 4 | Use of this source code is governed by an MIT-style
|
|---|
| 5 | license that can be found in the LICENSE file or at
|
|---|
| 6 | https://opensource.org/licenses/MIT.
|
|---|
| 7 | */
|
|---|
| 8 |
|
|---|
| 9 | import {getOrCreatePrecacheController} from './utils/getOrCreatePrecacheController.js';
|
|---|
| 10 | import './_version.js';
|
|---|
| 11 |
|
|---|
| 12 | /**
|
|---|
| 13 | * Takes in a URL, and returns the corresponding URL that could be used to
|
|---|
| 14 | * lookup the entry in the precache.
|
|---|
| 15 | *
|
|---|
| 16 | * If a relative URL is provided, the location of the service worker file will
|
|---|
| 17 | * be used as the base.
|
|---|
| 18 | *
|
|---|
| 19 | * For precached entries without revision information, the cache key will be the
|
|---|
| 20 | * same as the original URL.
|
|---|
| 21 | *
|
|---|
| 22 | * For precached entries with revision information, the cache key will be the
|
|---|
| 23 | * original URL with the addition of a query parameter used for keeping track of
|
|---|
| 24 | * the revision info.
|
|---|
| 25 | *
|
|---|
| 26 | * @param {string} url The URL whose cache key to look up.
|
|---|
| 27 | * @return {string} The cache key that corresponds to that URL.
|
|---|
| 28 | *
|
|---|
| 29 | * @memberof workbox-precaching
|
|---|
| 30 | */
|
|---|
| 31 | function getCacheKeyForURL(url: string): string | undefined {
|
|---|
| 32 | const precacheController = getOrCreatePrecacheController();
|
|---|
| 33 | return precacheController.getCacheKeyForURL(url);
|
|---|
| 34 | }
|
|---|
| 35 |
|
|---|
| 36 | export {getCacheKeyForURL};
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.