DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
← From Beginner to Expert in Fundamentals of Frontend
  • Semantic HTML
  • Accessibility (a11y)
  • Forms & Validation
  • Document Metadata & The <head>
  • The Document Object Model (DOM)
  • Character Encoding & Entities
  • Data Attributes & Custom Data
  • Template, Slot & Web Components
  • Responsive Images: Picture, Source & srcset
  • Loading Strategies & Resource Hints
  • The Native Dialog Element
  • Audio, Video & Media APIs
  • SVG Integration & Canvas Basics
  • Advanced Input Types & Datalist
  • Details, Summary, Progress & Meter
  • Global Attributes & Iframe Security
  • Microdata, Schema.org & Structured Data
  • Open Graph & Social Meta Tags
  • Security Headers & CSP in HTML
  • Link Relations & Canonical Tags
← From Beginner to Expert in Fundamentals of Frontend

Loading Strategies & Resource Hints

15 min read
lazy loadingpreloadprefetchpreconnectdns-prefetchasyncdefer

Loading Strategies: Controlling When Resources Load

Script Loading

AttributeDownloadExecuteOrder
NoneBlocks parsingImmediatelyIn order
asyncParallelWhen readyRandom
deferParallelAfter HTML parsedIn order
type=moduleParallelAfter HTML parsedIn order (deferred by default)

Resource Hints

  • preconnect: Establishes early connection (DNS + TCP + TLS)
  • dns-prefetch: Resolves DNS only (cheaper than preconnect)
  • preload: Fetches a resource needed for current page (high priority)
  • prefetch: Fetches a resource needed for next navigation (low priority)
  • prerender: Renders entire next page in background (Chrome)

Lazy Loading

loading="lazy" on img and iframe defers loading until the element is near the viewport. The browser handles all the IntersectionObserver logic natively.

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.