workbox.precaching. PrecacheController
Performs efficient precaching of assets.
Constructor
PrecacheController
new PrecacheController(cacheName)
Create a new PrecacheController.
Parameter |
|
---|---|
cacheName |
string |
Methods
activate
activate() returns Promise containing workbox.precaching.CleanupResult
Takes the current set of temporary files and moves them to the final cache, deleting the temporary cache once copying is complete.
- Returns
-
Promise containing workbox.precaching.CleanupResult
Resolves with an object containing details of the deleted cache requests and precache revision details.
addToCacheList
addToCacheList(entries)
This method will add items to the precache list, removing duplicates and ensuring the information is valid.
Parameter |
|
---|---|
entries |
Array of (module:workbox-precaching.PrecacheController.PrecacheEntry or string) Array of entries to precache. |
getCachedUrls
getCachedUrls() returns Array of string
Returns an array of fully qualified URL's that will be precached.
- Returns
-
Array of string
An array of URLs.
install
install(options) returns Promise containing workbox.precaching.InstallResult
Call this method from a service work install event to start precaching assets.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
options |
Object Values in
|
- Returns
-
Promise containing workbox.precaching.InstallResult