From c9f701c60980addedb56695ebfd0e287fff953a5 Mon Sep 17 00:00:00 2001 From: maiieul Date: Tue, 27 Aug 2024 14:55:29 +0200 Subject: [PATCH] Revert "docs: add info about Link prefetch option (#6814)" This reverts commit cd1e68c8ef2489759886edbb39b9038601ef2df1. --- .../src/routes/docs/(qwikcity)/api/index.mdx | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/packages/docs/src/routes/docs/(qwikcity)/api/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/api/index.mdx index d5b00e5c86e..5dd5af43c62 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/api/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/api/index.mdx @@ -453,38 +453,3 @@ export default component$(() => { ); }); ``` - -### Prefetch - -Whether Qwik should prefetch and cache the target page of this `Link`, this includes invoking any `routeLoader$`, `onGet`, etc. - -This **improves UX performance** for client-side (**SPA**) navigations. - -Prefetching occurs when a the Link enters the viewport in production (`on:qvisibile`), or with `mouseover`/`focus` during dev. - -Prefetching will not occur if the user has the **data saver** setting enabled. - -Setting this value to `"js"` will prefetch only javascript bundles required to render this page on the client, `false` will disable prefetching altogether. - -> Warning: if you have a menu with many links, all of them will be loaded immediately when you enter the production page, which may result with too many requests - -```tsx -import { component$ } from '@builder.io/qwik'; -import { Link } from '@builder.io/qwik-city'; - -export default component$(() => { - return ( -
- - page will not be prefetched - - - page js will be prefetched - - - page content & js will be prefetched - -
- ); -}); -```