Skip to content

Commit

Permalink
Revert "docs: add info about Link prefetch option (QwikDev#6814)"
Browse files Browse the repository at this point in the history
This reverts commit cd1e68c.
  • Loading branch information
maiieul committed Aug 27, 2024
1 parent ef3db67 commit c9f701c
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions packages/docs/src/routes/docs/(qwikcity)/api/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div>
<Link href="/a" prefetch={false}>
page will not be prefetched
</Link>
<Link href="/b" prefetch="js">
page js will be prefetched
</Link>
<Link href="/c">
page content & js will be prefetched
</Link>
</div>
);
});
```

0 comments on commit c9f701c

Please sign in to comment.