client:idle in Astro?client:idle on a component delays its hydration until the browser is idle. What is the main effect of this on the page behavior?Using client:idle defers hydration until the browser is idle, which means the component becomes interactive after the main page load tasks finish. This improves initial load speed and reduces CPU strain.
<head> section?Preloading fonts requires rel="preload", as="font", and crossorigin to ensure the font loads early and correctly.
<a href="/about" client:prefetch>About</a>Why might the prefetch not happen as expected when hovering over the link?
<a href="/about" client:prefetch>About</a>The client:prefetch directive only works on Astro components, not on plain HTML elements like <a>. To prefetch on links, you need to wrap them in a component or use native browser prefetch techniques.
client:visible on a component?client:visible hydration directive. What happens to the component's state and rendering behavior?client:visible delays hydration until the component enters the viewport, which means state and interactivity start only when the user scrolls to it.
Prefetching loads resources based on user behavior or idle time, so it avoids loading unnecessary files upfront. This saves bandwidth and speeds up perceived navigation without blocking initial page load.
