Render-blocking resources are files (typically CSS and JavaScript) that must be downloaded and processed before the browser can render the page.
Common render-blocking resources
CSS
- All CSS is render-blocking by default
- Browser waits to apply styles before painting
- Critical for visual appearance
JavaScript
- Scripts in
<head>block parsing by default - Can delay page rendering significantly
- Third-party scripts often problematic
How to identify render-blocking resources
- Run Lighthouse audit
- Check the "Eliminate render-blocking resources" recommendation
- Review the list of blocking CSS and JS files
Fixing render-blocking issues
For CSS
- Inline critical CSS
- Load non-critical CSS asynchronously
- Use media queries for conditional loading
For JavaScript
- Add
deferorasyncattributes - Move scripts to end of body
- Use dynamic imports for non-critical code
<script src="app.js" defer></script>
<link rel="preload" as="style" href="non-critical.css">
Related Terms
Critical Rendering Path
The sequence of steps the browser takes to convert HTML, CSS, and JavaScript into pixels on the screen.
First Contentful Paint (FCP)
A performance metric that measures the time from when the page starts loading to when any part of the page's content is rendered on screen.
JavaScript Execution Time
The time the browser spends parsing, compiling, and executing JavaScript code, which can block the main thread and delay interactivity.
Largest Contentful Paint (LCP)
A Core Web Vital that measures how long it takes for the largest content element visible in the viewport to render.