Preloading und Resource Hints
Nutzen Sie preload, prefetch, preconnect und Priority Hints, um Ressourcen des kritischen Pfads früher abzurufen und die Zeit bis zum ersten aussagekräftigen Rendering zu verkürzen.
Preloading und Resource Hints ist eine kostenlose Web Performance Optimization & Lighthouse-Lektion auf CoddyKit. Dies ist Lektion 4 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Web Performance Optimization & Lighthouse-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Web Performance Optimization & Lighthouse-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
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.
Lerne Web Performance Optimization & Lighthouse mit einem KI-Tutor — kostenlos
Schreibe und führe echten Code in deinem Browser aus, bekomme sofortige Hilfe von einem 24/7 KI-Tutor und setze dein Lernen im Web oder in der App fort.
- Kurse
- 12
- Lektionen
- 48
Häufig gestellte Fragen
Ist die Lektion „Preloading und Resource Hints“ kostenlos?
Ja — der vollständige Text von „Preloading und Resource Hints“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Web Performance Optimization & Lighthouse-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Web Performance Optimization & Lighthouse-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „Preloading und Resource Hints“?
Nutzen Sie preload, prefetch, preconnect und Priority Hints, um Ressourcen des kritischen Pfads früher abzurufen und die Zeit bis zum ersten aussagekräftigen Rendering zu verkürzen. Du übst Web Performance Optimization & Lighthouse mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um Web Performance Optimization & Lighthouse zu starten?
Keine Vorkenntnisse erforderlich. Web Performance Optimization & Lighthouse auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 4 von 4.
Wie lange dauert die Lektion „Preloading und Resource Hints“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser Web Performance Optimization & Lighthouse-Lektion Code schreiben und ausführen?
Ja. Jede Web Performance Optimization & Lighthouse-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Den kritischen Pfad verstehen
- Render-blockierende Ressourcen
- Inhalte für mehr Geschwindigkeit priorisieren
- Preloading und Resource Hints