You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,10 +79,10 @@ The above options are best for multi-page sites. Single-page apps have a few opt
79
79
*`urls`: Static array of URLs to prefetch (instead of observing `document` or a DOM element links in the viewport)
80
80
*`timeout`: Integer for the `requestIdleCallback` timeout. A time in milliseconds by which the browser must execute prefetching. Defaults to 2 seconds.
81
81
*`timeoutFn`: Function for specifying a timeout. Defaults to `requestIdleCallback`. Can also be swapped out for a custom function like [networkIdleCallback](https://github.com/pastelsky/network-idle-callback) (see demos)
82
-
*`priority`: String specifying preferred priority for fetches. Defaults to `low`. `high` will attempt to use the `fetch()` API where supported (rather than rel=prefetch)
82
+
*`priority`: Boolean specifying preferred priority for fetches. Defaults to `false`. `true` will attempt to use the `fetch()` API where supported (rather than rel=prefetch)
83
83
84
84
TODO:
85
-
* Explore detecting file-extension of resources and using [rel=preload](https://w3c.github.io/preload/) for `high` priority fetches
85
+
* Explore detecting file-extension of resources and using [rel=preload](https://w3c.github.io/preload/) for high priority fetches
86
86
* Explore using [Priority Hints](https://github.com/WICG/priority-hints) for importance hinting
87
87
88
88
## Polyfills
@@ -133,11 +133,10 @@ quicklink({
133
133
134
134
**Set the request priority for prefetches**
135
135
136
-
Defaults to low-priority (`rel=prefetch` or XHR). For high-priority,
137
-
attempts to use `fetch()` or falls back to XHR.
136
+
Defaults to low-priority (`rel=prefetch` or XHR). For high-priority (`priority: true`), attempts to use `fetch()` or falls back to XHR.
138
137
139
138
```js
140
-
quicklink({ priority:'high' });
139
+
quicklink({ priority:true });
141
140
```
142
141
143
142
## Browser support
@@ -147,7 +146,7 @@ The prefetching provided by `quicklink` can be viewed as a [progressive enhancem
0 commit comments