prefetch
ts
Prefetch and cache data from a URL. A later call to imf.loadFileFromUrl() with the same URL will use the cached bytes or take ownership of the fetch if still in flight.
The data is removed from cache when consumed by loadFileFromUrl, or when discarded via the signal or clearPrefetch.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | - |
options? | { signal?: AbortSignal; priority?: RequestPriority; } | - |
options.signal? | AbortSignal | Aborts the fetch and discards any bytes already downloaded. |
options.priority? | RequestPriority | Fetch priority hint. Use 'low' for background prefetching. |
Returns
void
Example
ts