RuntimeCacheRule
Fetched data to cache at run time, e.g. the viewer's samples or an example's .vox files: files from the public directory, which are not part of the bundle and so are not precached. Matching responses go to a cache of their own that survives deploys (their URLs carry no hash, so a new build does...
Defined in: engine/src/pwa/vite.ts:25
Fetched data to cache at run time, e.g. the viewer's samples or an example's .vox files:
files from the public directory, which are not part of the bundle and so are not precached.
Matching responses go to a cache of their own that survives deploys (their URLs carry no hash,
so a new build does not make them stale; stale-while-revalidate refreshes them anyway).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
match | string | RegExp | Which requests, by path relative to the app's base: a string is a prefix ("samples/", "models/"), a RegExp is tested against the relative path (/\.vox$/). | engine/src/pwa/vite.ts:30 |
strategy? | CacheStrategy | How to answer (default stale-while-revalidate): - stale-while-revalidate: the cached copy at once, refreshed from the network behind it; - cache-first: the cached copy if there is one, else the network (for files that never change); - network-first: the network, the cached copy only when offline. | engine/src/pwa/vite.ts:37 |