This component capture mouse hovering on links with internal URLs.
Then, it will prefetch the HTML document beforehand.
The goal is to make further page loading snappier.
It's useful with SSG but also with SSR in certain scenarios.
It plays well with this page transition component:
astro-page-transition
pnpm i astro-hover-prefetch
---
import { HoverPrefetch } from 'astro-hover-prefetch';
// ...
---
<!-- ... -->
<head>
<!-- Place component inside `HEAD` tag -->
<!-- 'max' property is optional -->
<HoverPrefetch max={8} />
<!-- ... -->
</head>