Panduan Resource Hints

Bagaimana preload, preconnect, dns-prefetch, dan prefetch resource hints speed up halaman memuat dan meningkatkan Core Web Vitals, dan ketika untuk gunakan setiap satu.

Pertama kali diterbitkan: 2 Jul 2026 · Terakhir diperbarui: 3 Agu 2026 · Lanjutan

Resource hints (dns-prefetch, preconnect, preload, prefetch) tell browser untuk melakukan network berfungsi — DNS lookups, connection setup, atau fetching — sebelumnya daripada ini jika tidak akan. dns-prefetch adalah cheapest (DNS hanya); preconnect melakukan penuh DNS+TCP+TLS handshake; preload adalah sebuah mandatory fetch untuk sebuah late-ditemukan resource saat ini halaman perlu (like sebuah LCP image atau sebuah font di CSS) — tetapi -nya default priority masih bergantung pada resource jenis, tidak secara otomatis "high" _(terjemahan)_ “tinggi” (fetchpriority adalah sebuah terpisah hint untuk itu); prefetch adalah sebuah rendah-priority speculative fetch untuk sebuah future halaman. big failure mode adalah overuse — preload semuanya dan Anda've prioritized tidak ada apa pun. dan menjadi honest tentang SEO: per Gary Illyes (Feb 2026), ini hints jangan help Googlebot crawl atau indeks lebih cepat; mereka nilai adalah entirely pada nyata-pengguna side, yang alur ke Core Web Vitals, satu dari several sinyal Google's peringkat sistem gunakan — baik scores jangan jaminan top rankings.

«> TL;DR — The main resource hints form a spectrum of browser cost:

dns-prefetch (DNS lookup only) → preconnect (DNS + TCP + TLS) → preload (a mandatory fetch of a specific, late-discovered resource) → prefetch (lowest-priority speculative fetch for a future navigation). modulepreload is preload’s sibling for JS modules. preload is the only one the browser is obligated to fetch — that’s different from saying it’s automatically high priority; default priority still depends on the resource type, and fetchpriority is a separate hint for raising it. The as attribute is required on preload; crossorigin is required for fonts and other anonymous-mode fetches, or the browser downloads the resource twice. Overuse is the dominant failure mode. And per Gary Illyes (Feb 2026), none of this helps Googlebot — the SEO value is entirely indirect, through Core Web Vitals, which is one of several ranking signals, not a deterministic one. » (Terjemahan) (Ringkasan bahasa Indonesia untuk bagian enam belas, bagian kecil satu: teks sumber dipertahankan agar dapat diperiksa dalam tinjauan penutur asli.)

Bukti untuk klaim ini Preload declares a resource needed for the current navigation and fetches it with the resource's destination semantics. Cakupan: Current official or standards documentation. Tingkat keyakinan: tinggi · Diverifikasi: MDN: preload Bukti untuk klaim ini Preconnect asks the browser to establish an early connection to an origin and should be limited to important origins. Cakupan: Current official or standards documentation. Tingkat keyakinan: tinggi · Diverifikasi: MDN: preconnect

«## A spectrum of browser “cost” » (Terjemahan) (Ringkasan bahasa Indonesia untuk bagian delapan belas, bagian kecil satu: teks sumber dipertahankan agar dapat diperiksa dalam tinjauan penutur asli.)

paling bersih mental model untuk resource hints adalah untuk line them up oleh bagaimana banyak berfungsi Anda’re asking browser untuk melakukan up front:

«1. dns-prefetch — resolve a hostname to an IP. Cheapest. 2. preconnect — DNS lookup plus the TCP handshake plus TLS negotiation for HTTPS. A full open connection, ready to use. 3. preload — go actually fetch a specific resource, now. The browser must process the fetch, but that doesn’t automatically make it high priority — more on that below. 4. modulepreload — preload’s sibling for JavaScript modules; fetches the module into the browser’s module map using module-script rules rather than a generic fetch. 5. prefetch — go fetch a specific resource, but at the lowest priority, for a page the user hasn’t navigated to yet. » (Terjemahan) (Ringkasan bahasa Indonesia untuk bagian dua puluh, bagian kecil satu: teks sumber dipertahankan agar dapat diperiksa dalam tinjauan penutur asli.)

mereka go di satu dari dua places: sebuah <link> element di <head>, atau sebuah HTTP Link respons header (lebih pada header path, dan 103 Early Hints, di bawah). None dari ini adalah document-tingkat Speculation aturan API — itu’s sebuah terpisah mechanism untuk prerendering/prefetching seluruh navigations, covered di prefetch bagian di bawah.

dns-prefetch

«dns-prefetch performs just the DNS lookup for a cross-origin server ahead of time — it doesn’t open a connection. That makes it the cheapest hint and a sensible default for the many lower-priority third-party domains a page touches (analytics, tag managers, minor widgets). In my own Largest Contentful Paint guide I make the practical point that “DNS-prefetch has better support than preconnect” — so it’s also a reasonable fallback for browsers where preconnect isn’t honored. » (Terjemahan) (Ringkasan bahasa Indonesia untuk bagian dua puluh tiga, bagian kecil satu: teks sumber dipertahankan agar dapat diperiksa dalam tinjauan penutur asli.)

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

preconnect

preconnect goes further: ini opens seluruh connection — DNS, TCP, dan (untuk HTTPS) TLS handshake — so itu oleh time browser perlu resource, pipe adalah sudah warm. itu’s sebuah bigger win daripada dns-prefetch, tetapi ini adalah juga lebih expensive untuk browser, yang adalah mengapa ini muncul dengan dua penting caveats:

  • Reserve ini untuk Anda sebagian besar critical cross-origin connections. sebuah handful (Anda font host, Anda image CDN, sebuah critical script origin) — tidak semuanya. Google’s Lighthouse “Preconnect to required origins” (terjemahan) “Preconnect untuk diperlukan origins” audit dan web.dev keduanya warn itu unnecessary preconnects delay lainnya penting berfungsi.
  • sebuah unused connection adalah wasted berfungsi. browser close sebuah connection itu tidak digunakan di dalam tentang 10 seconds, so sebuah preconnect untuk sesuatu Anda tidak sebenarnya fetch soon hanya burns handshake capacity untuk tidak ada apa pun.

untuk fonts, preconnect perlu crossorigin attribute — fonts adalah selalu fetched di anonymous (CORS) mode, dan tanpa ini browser opens sebuah kedua connection anyway, defeating poin.

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

preload

preload adalah satu browser adalah obligated untuk execute — jika ini memproses tag, ini harus mulai fetch untuk sebuah resource saat ini halaman definitely perlu tetapi akan jika tidak menemukan late. itu’s sebuah statement tentang ketika fetch dimulai, tidak secara otomatis tentang priority: default priority sebuah preloaded resource mendapatkan masih bergantung pada resource jenis dan browser (web.dev adalah jelas itu images, misalnya, stay rendah priority oleh default bahkan ketika preloaded). jika Anda ingin sebenarnya raise sebuah resource’s priority, itu’s sebuah terpisah, jelas hint — fetchpriority — tidak sesuatu preload melakukan pada -nya own. classic candidates untuk preload:

  • Fonts referenced di dalam sebuah CSS file — browser tidak know font ada until ini downloads dan parses CSS, so preload surfaces ini sebelumnya.
  • ** LCP (hero) image**, terutama satu set melalui CSS atau srcset itu tidak sebuah plain early <img> di HTML.
  • Critical, late-ditemukan JavaScript atau CSS.

Dua attributes membuat atau break ini:

  • as adalah diperlukan. ini tells browser apa jenis dari resource ini adalah so ini dapat assign right priority dan match cache entry. Omit ini dan browser memperlakukan permintaan like sebuah generic XHR — wrong priority, dan sering sebuah duplicate download.
  • crossorigin untuk fonts — sama aturan sebagai preconnect; miss ini dan font downloads twice.

Lebih umumnya, sebuah preload hanya mendapatkan reused jika eventual permintaan matches ini: sama URL, sama as/destination, yang sama type atau media condition, matching crossorigin/credentials mode, dan — di mana mereka apply — matching integrity dan referrerpolicy. untuk sebuah responsive image preload, itu juga berarti menggunakan imagesrcset/imagesizes itu mirror srcset/sizes browser akan sebenarnya pick, tidak sebuah single unconditional fallback URL. Mendapatkan apa pun dari ini out dari sync dan browser either dapat’t reuse preload (duplicate fetch) atau fetches wrong candidate.

«For the LCP image specifically, Google’s current recommendation is to pair preload with fetchpriority="high" so the fetch starts alongside the stylesheet. This is the combo I describe in my LCP guide too — fetchpriority="high" gets the image earliest, and preloading is a strong second signal, useful because as I note there, “Early Hints don’t work on all browsers, so you may also want to preload the image.” » (Terjemahan) (Ringkasan bahasa Indonesia untuk bagian tiga puluh enam, bagian kecil satu: teks sumber dipertahankan agar dapat diperiksa dalam tinjauan penutur asli.)

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

<!-- Font in CSS -->
<link rel="preload" as="font" type="font/woff2" href="/fonts/inter.woff2" crossorigin>

«The overuse warning applies hardest here: if everything is preloaded at high priority, effectively nothing is. web.dev is explicit that excessive preloads cause bandwidth contention, and it hits hardest on slow networks. Preload the two or three genuinely late-discovered, genuinely critical resources — no more. » (Terjemahan) (Ringkasan bahasa Indonesia untuk bagian tiga puluh delapan, bagian kecil satu: teks sumber dipertahankan agar dapat diperiksa dalam tinjauan penutur asli.)

modulepreload

modulepreload adalah preload’s padanan untuk JavaScript modules. alih-alih sebuah generic resource fetch, ini menggunakan module-script fetch aturan dan puts hasil straight ke browser’s module map — so ketika module adalah kemudian imported, browser sudah memiliki ini. Depending pada browser, ini dapat juga go ahead dan fetch module’s static imports. mendukung dan bagaimana deep itu dependency-fetching goes keduanya vary oleh browser, so test sebenarnya perilaku alih-alih assuming ini matches preload.

<link rel="modulepreload" href="/js/app.module.js">

prefetch

prefetch adalah odd satu out: ini adalah tidak tentang saat ini halaman di semua. ini adalah sebuah rendah-priority, speculative fetch untuk sebuah resource sebuah future navigation akan mungkin perlu — langkah berikutnya di sebuah checkout, artikel sebuah pengguna adalah tentang untuk click. Karena ini berjalan di lowest priority, ini tidak steal bandwidth dari saat ini halaman’s critical resources, dan prefetched files land di HTTP cache (jika mereka’re cacheable) ready untuk berikutnya navigation.

trade-off: jika pengguna tidak pernah goes di sana, Anda’ve spent bytes untuk tidak ada apa pun — so apply ini thoughtfully dan hindari ini pada slow atau metered connections.

<link rel="prefetch" href="/checkout/step-2" as="document">

Looking forward, Speculation aturan API adalah modern successor untuk prefetch untuk predicting sama-situs navigations; web.dev notes ini menangani cases plain prefetch dapat’t (like non-cacheable navigations) dan behaves lebih consistently di seluruh origins. prefetch tetap berguna dan lebih broadly didukung di meantime.

«## Preload vs. prefetch vs. preconnect vs. dns-prefetch » (Terjemahan) (Ringkasan bahasa Indonesia untuk bagian empat puluh tujuh, bagian kecil satu: teks sumber dipertahankan agar dapat diperiksa dalam tinjauan penutur asli.)

«| Hint | What it does | Priority | Browser must obey? | Best for | | --- | --- | --- | --- | --- | | dns-prefetch | DNS lookup only | — | Suggestion | Many lower-priority third-party domains | | preconnect | DNS + TCP + TLS (full connection) | — | Suggestion | Your few most critical cross-origin origins | | preload | Fetch a specific resource | Resource/browser-dependent — not automatically high; pair with fetchpriority to raise it | Yes, if processed | Late-discovered critical resources on this page | | modulepreload | Fetch a JS module into the module map | Resource/browser-dependent | Yes, if processed | Late-discovered ES modules this page needs | | prefetch | Fetch a specific resource, lowest priority | Lowest | Suggestion | Resources for a likely future navigation | » (Terjemahan) (Ringkasan bahasa Indonesia untuk bagian empat puluh delapan, bagian kecil satu: teks sumber dipertahankan agar dapat diperiksa dalam tinjauan penutur asli.)

Resource hints dan Core Web Vitals

Di sini’s bagian SEOs sebenarnya care tentang — yang hint moves yang metric:

  • dns-prefetch / preconnect shave connection latency, yang menampilkan up sebagai sebuah lebih cepat mulai untuk memuat Anda critical resources — feeding LCP dan, sebelum ini, FCP.
  • preload acts pada LCP dan FCP sebagian besar secara langsung oleh starting fetch dari LCP image atau sebuah render-critical font/stylesheet sebelumnya.
  • prefetch tidak touch saat ini halaman’s Core Web Vitals di semua — ini improves berikutnya halaman’s LCP/FCP oleh memiliki -nya resources sudah cached.

None dari ini secara langsung memengaruhi INP atau CLS, though getting fonts di sebelumnya (melalui preload) dapat indirectly reduce layout shift dari font swaps — itu’s benar-benar sebuah font memuat topic, dan render-blocking resources adalah sibling artikel pada fetch-order side dari yang sama masalah.

melakukan resource hints help Google crawl atau indeks my situs?

Tidak — dan ini adalah single sebagian besar penting nuance untuk mendapatkan right, karena sebagian besar konten pada ini topic adalah vague tentang ini.

«In a February 2026 Search Off the Record episode, Google’s Gary Illyes explained why Googlebot largely ignores these hints: they solve browser and network latency problems that Google’s own crawling infrastructure doesn’t have. As reported by Search Engine Journal, Illyes said “it’s very helpful if you have like a crappy internet to do DNS Prefetching for example. In our case, we don’t need to because we can talk very fast to all the cascading DNS servers.” Jump to quote He made the same point about preload — “Same with preload. If we are not synchronous then we don’t particularly need to look at preload.” Jump to quote » (Terjemahan) (Ringkasan bahasa Indonesia untuk bagian lima puluh lima, bagian kecil satu: teks sumber dipertahankan agar dapat diperiksa dalam tinjauan penutur asli.)

So correct causal chain adalah: resource hints → lebih cepat nyata-pengguna experience → better Core Web Vitals → satu dari several sinyal Google’s peringkat sistem gunakan. Google’s own pengalaman halaman documentation adalah jelas itu ada Tidak single halaman-experience sinyal, itu Core Web Vitals adalah digunakan oleh peringkat sistem alongside others, dan itu baik CWV scores jangan jaminan sebuah top peringkat — relevance masih wins di atas pengalaman halaman. So ini adalah tidak tidak ada apa pun — tetapi resource hints adalah sebuah UX/performa tactic pertama, dan mereka SEO nilai adalah entirely downstream dan non-deterministic. jangan sell them internally sebagai “this helps Google read the page.” (terjemahan) “ini helps Google baca halaman.”

Bing, untuk apa ini adalah worth, memiliki published Tidak hint-spesifik guidance di semua — -nya webmaster guidance references situs speed generically. browser-tingkat benefits (lebih cepat memuat, better vitals) apply yang sama regardless dari mesin pencari, so ada Tidak terpisah “Bing angle” (terjemahan) “Bing angle” untuk mengoptimalkan untuk di sini.

Delivering hints di atas HTTP: tautan header dan 103 Early Hints

Resource hints jangan memiliki untuk langsung di Anda HTML. Anda dapat kirim them sebagai sebuah HTTP Link respons header — Link: </hero.webp>; rel=preload; as=image — yang adalah bagaimana server- dan CDN-tingkat implementations berfungsi. paling interesting versi dari ini adalah 103 Early Hints: sebuah preliminary HTTP status itu lets sebuah edge (like Cloudflare) kirim cached preload/preconnect Link headers sebelum origin server memiliki bahkan finished generating penuh respons — giving browser sebuah head mulai pada connections dan fetches sementara ini menunggu. I cover 103 status itself di my HTTP kode status guide, di mana I deskripsikan ini sebagai letting Anda preload resources untuk help LCP untuk Core Web Vitals.

umum mistakes

  • Preloading too banyak resources — cardinal sin; ini membuat bandwidth contention dan dapat membuat halaman lebih lambat overall.
  • Preloading hal browser sudah menemukan early — sebuah early <img> di HTML tidak perlu preloading; Anda’re hanya spending sebuah permintaan slot.
  • Missing as pada preload — wrong priority dan sering sebuah double download.
  • Missing crossorigin pada font preload/preconnect — sebuah mismatched cache entry berarti font downloads twice.
  • Stale, unused preconnect tags — left behind setelah Anda dihapus ketiga-party script mereka adalah untuk, holding connections open untuk 10 seconds sebelum browser memberikan up.
  • Ignoring cost beyond Anda own halaman — unused hints jangan hanya waste Anda own bandwidth; mereka consume sockets dan server/ketiga-party capacity, dan dns-prefetch/preconnect dapat reveal mungkin destinations untuk network observers. browser dapat juga ignore, cancel, atau limit hints di bawah Save-data, rendah-power, atau mendukung constraints — prefetch di particular adalah treated sebagai opsional dan skipped untuk reduced-data pengguna, so jangan assume sebuah hint Anda shipped adalah sebenarnya berjalan untuk setiap pengunjung.
Bukti untuk klaim ini Unused preconnects and fetch hints can consume sockets, bandwidth, CPU, memory and server/third-party capacity, reveal likely destinations or trigger privacy-sensitive network activity; browsers may ignore, cancel or limit hints under settings, support or data-saving constraints. Cakupan: future-resource speculation Tingkat keyakinan: tinggi · Diverifikasi: Prefetching, prerendering, and service worker precaching

cara test dan audit

  • Lighthouse / PageSpeed Insights — “Preconnect to required origins” (terjemahan) “Preconnect untuk diperlukan origins” audit flags missing preconnects pada key permintaan; treat ini sebagai sebuah prompt untuk tambahkan sebuah targeted satu, tidak untuk carpet-bomb.
  • Chrome DevTools → Network panel — Priority column menampilkan apa browser sebenarnya prioritized, dan Anda dapat spot preloaded resources fetching twice ( as/crossorigin bugs).
  • periksa untuk unused preconnects — jika sebuah preconnected origin tidak pernah muncul sebagai sebuah sebenarnya permintaan, hapus hint.

untuk metrics ini semua feed, see Core Web Vitals dan Largest Contentful Paint; web performa alat artikel covers pengukuran stack secara mendalam.

Tambahkan catatan pakar

Sematkan kutipan pakar

Orang baru? Buat profilnya yang belum diklaim di /admin/experts/ → Sematkan kutipan pakar terlebih dahulu.