Interview Question

What is prefetch in HTML?

Prefetch suggests a likely future resource, while preload targets the current page.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

Prefetch is a resource hint for a resource that may be needed by a future navigation. • It uses `<link rel="prefetch" href="...">`. • The browser decides whether and when to perform the low-priority fetch. • Do not use prefetch for resources required immediately by the current page.

💡 Simple Example

<head><link rel="prefetch" href="/next-lesson.html"></head>

⚡ Quick Revision

Prefetch suggests a likely future resource, while preload targets the current page.