0Pricing
Web Performance Optimization & Lighthouse · Lezione

Preload e suggerimenti per le risorse

Usi preload, prefetch, preconnect e i suggerimenti di priorità per recuperare prima le risorse del percorso critico e ridurre il tempo necessario al primo rendering significativo.

Preload e suggerimenti per le risorse è una lezione Web Performance Optimization & Lighthouse gratuita su CoddyKit. Questa è la lezione 4 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento Web Performance Optimization & Lighthouse, e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso Web Performance Optimization & Lighthouse include 4 lezioni in totale.

Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.

Helping the Browser Prioritize

The browser discovers resources as it parses HTML, but key assets like fonts or hero images may be found late. Resource hints let you tell the browser what to fetch early, shrinking the critical path.

preconnect

preconnect opens the DNS + TCP + TLS connection to an origin ahead of time, so the actual request starts faster. Ideal for font and CDN origins.

<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

dns-prefetch

dns-prefetch is a lighter hint that resolves only DNS. Use it as a fallback for browsers without preconnect or for many third-party origins.

<link rel="dns-prefetch" href="https://analytics.example.com">

preload

preload fetches a specific resource the current page needs soon, at high priority. Always set the correct as attribute so the browser assigns the right priority and reuses the fetch.

<link rel="preload" href="/fonts/inter.woff2" as="font" type="font/woff2" crossorigin>

Preloading the LCP Image

The hero image driving Largest Contentful Paint is often discovered late. Preloading it can cut LCP significantly.

<link rel="preload" href="/hero.webp" as="image" fetchpriority="high">

prefetch

prefetch fetches resources for a future navigation at low priority during idle time. Great for the next page a user is likely to visit.

<link rel="prefetch" href="/dashboard.js">

Priority Hints

The fetchpriority attribute nudges relative priority. Mark the hero image high and below-the-fold or non-critical assets low.

<img src="/hero.webp" fetchpriority="high" alt="Hero">
<img src="/footer-logo.png" fetchpriority="low" alt="Logo">

modulepreload

For ES modules, modulepreload preloads a module and its dependency graph, avoiding the waterfall of discovering imports one by one.

<link rel="modulepreload" href="/app.mjs">

Avoiding Over-Preloading

Hints compete for bandwidth. Preloading too much delays truly critical resources and can hurt performance. Preload only assets that are critical and discovered late.

Verifying Hints

Check the DevTools Network panel: preloaded resources show high priority and early start times. Lighthouse flags both missing preloads for the LCP element and unused preloads.

Choosing the Right Hint

  • preconnect warm up an origin.
  • preload critical asset for this page.
  • prefetch asset for the next page.
  • fetchpriority fine-tune relative order.

Quick Check

You want a hero image that drives LCP to download as early and as high priority as possible. Which hint fits best?

Recap

You learned to steer the critical path with resource hints: preconnect/dns-prefetch for connections, preload/modulepreload for current-page assets, prefetch for future pages, and fetchpriority to fine-tune. Use them sparingly and verify in DevTools.

Domande Frequenti

La lezione «Preload e suggerimenti per le risorse» è gratuita?

Sì — il testo completo di «Preload e suggerimenti per le risorse» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso Web Performance Optimization & Lighthouse, passa a CoddyKit PRO. Il corso Web Performance Optimization & Lighthouse include 4 lezioni in totale.

Cosa imparerò in «Preload e suggerimenti per le risorse»?

Usi preload, prefetch, preconnect e i suggerimenti di priorità per recuperare prima le risorse del percorso critico e ridurre il tempo necessario al primo rendering significativo. Eserciti Web Performance Optimization & Lighthouse con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.

Ho bisogno di esperienza per iniziare Web Performance Optimization & Lighthouse?

Non è richiesta alcuna esperienza precedente. Web Performance Optimization & Lighthouse su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 4 di 4.

Quanto tempo richiede la lezione «Preload e suggerimenti per le risorse»?

La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.

Posso scrivere ed eseguire codice in questa lezione Web Performance Optimization & Lighthouse?

Sì. Ogni lezione Web Performance Optimization & Lighthouse include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.

Tutte le lezioni di questo corso

  1. Comprendere il percorso critico
  2. Risorse che bloccano il rendering
  3. Prioritizzazione dei contenuti per la velocità
  4. Preload e suggerimenti per le risorse
← Torna a Web Performance Optimization & Lighthouse