Skip to main content
InterviewHubPRO
Section Overview
Q40

Question 40 of 50

Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

80%
HTML5 & Web APIs (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

Resource Hints: `preload`, `prefetch`, `preconnect`, `dns-prefetch`, and `modulepreload`.

senior LevelCode ExampleSystem DesignRabbitMQHTTP & REST APIs

In Simple Words: Resource hints optimize browser network loading priorities:

  1. dns-prefetch: Resolves DNS IP addresses of external domains in advance (low overhead).
  2. preconnect: Performs DNS resolution + TCP handshake + TLS negotiation in advance (e.g. for Google Fonts CDN).
  3. preload: High-priority instruction telling the browser to fetch a critical resource needed for the current page immediately (e.g. hero font or LCP image).
  4. prefetch: Low-priority hint telling the browser to fetch resources likely needed on the next user navigation when idle.
  5. modulepreload: Preloads and pre-parses ES module scripts into memory.
html
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preload" href="/fonts/inter.woff2" as="font" type="font/woff2" crossorigin>
<link rel="prefetch" href="/checkout.js">