From 2720ef4bd290a75859527a80bb9c96331cd14ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AE=80=E9=9D=99=E5=87=A1?= Date: Wed, 27 Dec 2023 20:54:47 +0800 Subject: [PATCH] [prefetch.mdx] Adds a `'load'` prefetch strategy Link to https://github.com/withastro/astro/pull/9513 --- src/content/docs/en/guides/prefetch.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/prefetch.mdx b/src/content/docs/en/guides/prefetch.mdx index 6545a93b2c923..8534c85e94e48 100644 --- a/src/content/docs/en/guides/prefetch.mdx +++ b/src/content/docs/en/guides/prefetch.mdx @@ -37,6 +37,7 @@ Astro supports 3 prefetch strategies for various use cases: - `hover` (default): Prefetch when you hover over or focus on the link. - `tap`: Prefetch just before you click on the link. - `viewport`: Prefetch as the links enter the viewport. +- `load`: Prefetch the links on page load. You can specify a strategy for an individual link by passing it to the `data-astro-prefetch` attribute: @@ -48,7 +49,7 @@ Each strategy is fine-tuned to only prefetch when needed and save your users' ba - If a visitor is using [data saver mode](https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/saveData) or has a [slow connection](https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/effectiveType), prefetch will fallback to the `tap` strategy. - Quickly hovering or scrolling over links will not prefetch them. -- Links that use the `viewport` strategy are prefetched with a lower priority to avoid clogging up the network. +- Links that use the `viewport` or `load` strategy are prefetched with a lower priority to avoid clogging up the network. ### Default prefetch strategy