Pré-Carregamento e Dicas de Recursos
Use preload, prefetch, preconnect e dicas de prioridade para buscar recursos essenciais mais cedo e reduzir o tempo até a primeira renderização significativa.
Pré-Carregamento e Dicas de Recursos é uma aula grátis de Web Performance Optimization & Lighthouse no CoddyKit. Esta é a aula 4 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Web Performance Optimization & Lighthouse, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Web Performance Optimization & Lighthouse inclui 4 aulas no total.
Partes desta aula ainda não foram traduzidas e aparecem em inglês.
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.
Aprenda Web Performance Optimization & Lighthouse com um tutor de IA — grátis
Escreva e execute código real no seu navegador, obtenha ajuda instantânea de um tutor de IA 24/7 e continue de onde parou na web ou no app.
- Cursos
- 12
- Aulas
- 48
Perguntas Frequentes
A aula “Pré-Carregamento e Dicas de Recursos” é grátis?
Sim — o texto completo de “Pré-Carregamento e Dicas de Recursos” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Web Performance Optimization & Lighthouse, atualize para CoddyKit PRO. O curso de Web Performance Optimization & Lighthouse inclui 4 aulas no total.
O que vou aprender em “Pré-Carregamento e Dicas de Recursos”?
Use preload, prefetch, preconnect e dicas de prioridade para buscar recursos essenciais mais cedo e reduzir o tempo até a primeira renderização significativa. Você pratica Web Performance Optimization & Lighthouse com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.
Preciso ter experiência prévia para começar Web Performance Optimization & Lighthouse?
Nenhuma experiência prévia é necessária. Web Performance Optimization & Lighthouse no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 4 de 4.
Quanto tempo leva a aula “Pré-Carregamento e Dicas de Recursos”?
A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.
Posso escrever e executar código nesta aula de Web Performance Optimization & Lighthouse?
Sim. Cada aula de Web Performance Optimization & Lighthouse inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.
Todas as aulas deste curso
- Compreensão do caminho crítico
- Recursos que bloqueiam a renderização
- Priorização de conteúdo para obter velocidade
- Pré-Carregamento e Dicas de Recursos