Mahamudul Hasan Rubel
HomeAboutProjectsSkillsExperienceBlogPhotosContact
Mahamudul Hasan Rubel

Senior Software Engineer crafting high-performance web applications and SaaS platforms.

Navigation

  • Home
  • About
  • Projects
  • Skills
  • Experience
  • Blog
  • Photos
  • Contact

Get in Touch

Available for senior/lead roles and consulting.

bd.mhrubel@gmail.comHire Me

© 2026 Mahamudul Hasan Rubel. All rights reserved.

Built with using Next.js 16 & Tailwind v4

Back to Blog
PerformanceJune 23, 20264 min read

Browser Resource Prioritization: Controlling Network Scheduling

Master browser resource prioritization using Fetch Metadata and Document Policy. Stop network congestion and improve your LCP by controlling request scheduling.

web performancebrowser optimizationnetworklcpfetch metadatadocument policyPerformanceWeb VitalsFrontend

I spent three days last month staring at a waterfall chart that made no sense. Our Largest Contentful Paint (LCP) was hovering around 2.4 seconds, but the browser was busy downloading three different tracking scripts and a decorative icon font while the hero image sat in the queue.

We had plenty of bandwidth, but the browser’s internal scheduler was being "too smart" for its own good. It saw a bunch of requests and prioritized them based on default heuristics that didn't align with our business logic. If you’ve ever felt like your site is fighting against the browser’s own resource management, you aren't alone.

Understanding Browser Resource Prioritization

Modern browsers are incredibly efficient at Resource Prioritization: Using Fetch Priority for LCP Optimization, but they rely on static rules. They don't know that your hero image is more important than a third-party chat widget.

When you have a congested network—especially on mobile devices—the browser’s default network scheduling creates a bottleneck. It grabs whatever it sees first, often leading to a "first-come, first-served" scenario that punishes your performance metrics. We’ve historically tried to solve this with preload or preconnect, but those are blunt instruments. They tell the browser what to fetch, but not why or under what conditions.

The Wrong Turn: Over-Preloading

My first instinct was to add rel="preload" to every asset above the fold. It felt like a win. The browser started downloading everything immediately.

The problem? I saturated the connection. By forcing the browser to prioritize everything, I effectively de-prioritized nothing. The critical CSS and the hero image were now competing with a massive JavaScript bundle I’d preloaded. Our LCP actually dropped by about 300ms because the browser was fighting for socket availability.

I learned the hard way that you cannot "force" speed by telling the browser to do everything at once. You have to be selective.

Using Fetch Metadata for Intelligent Scheduling

Fetch Metadata request headers are a game-changer for server-side control. They allow your backend to see how and why a request was initiated. When a browser makes a request, it sends headers like Sec-Fetch-Site, Sec-Fetch-Mode, and Sec-Fetch-Dest.

I started using these to block or delay non-critical requests at the edge. If the server detects a request is coming from a cross-site context for an asset that isn't strictly necessary for the initial paint, we return a 204 No Content or a delayed response.

Here is how we set up our Nginx configuration to identify and categorize traffic:

NGINX
# Deny cross-site requests for our internal assets
if ($http_sec_fetch_site = "cross-site") {
    # We can use this to throttle or block non-essential resources
    # at the Nginx level before they even hit the app logic.
}

By filtering at the edge, you stop the browser from wasting network scheduling cycles on assets you don't need until the page is interactive. It’s a clean way to ensure your critical path stays clear.

Controlling Network Scheduling with Document Policy

While Fetch Metadata helps the server decide what to send, Document Policy helps the browser decide what to execute. It’s a relatively new header that allows you to enforce certain behaviors across the entire document.

I started experimenting with Document-Policy: force-load-at-top. It’s not a silver bullet, but it helps keep the document flow predictable. More importantly, we’ve been looking at how to combine this with Optimizing the Critical Request Chain: A Guide to HTTP/3 & Early Hints to push critical assets before the browser even parses the HTML.

The real power of Document Policy lies in its ability to disable features that often cause background noise. If you don't need a specific API, disabling it prevents the browser from loading the associated overhead.

Putting It All Together

To fix our LCP issue, we didn't just use one tool. We combined:

  1. Fetch Metadata: To identify and drop low-priority requests at the edge.
  2. Fetch Priority API: To explicitly mark our hero image as high and secondary content as low.
  3. Selective Loading: We stopped preloading everything and focused only on the LCP element.

The result was a shift from a 2.4s LCP to roughly 1.6s. It wasn't a magic fix; it was just removing the noise.

FAQ

Does Fetch Metadata work on all browsers? It has broad support in Chromium-based browsers and Firefox. Safari support is still catching up, so always have a fallback.

Is Document Policy overkill for small sites? Probably. If your site is simple, standard preloading and good cache headers are enough. Use these tools when you have complex third-party dependencies that are fighting for bandwidth.

Will this break my analytics? If you aren't careful, yes. If you block requests based on Fetch Metadata, ensure your analytics scripts are excluded from those rules, or you’ll lose your data.

I’m still playing with the balance between aggressive caching and real-time prioritization. Sometimes, I worry I’m over-engineering the network layer, but when the waterfall chart finally looks clean, it’s hard to argue with the results. Next time, I think I’ll focus more on automating the identification of these assets in our CI/CD pipeline rather than manual Nginx rule updates.

Back to Blog

Similar Posts

PerformanceJune 23, 20264 min read

Hydration optimization: Reducing TBT with Selective Serialization

Hydration optimization is key to faster sites. Learn how selective serialization reduces total blocking time by preventing massive JSON parsing on the client.

Read more
PerformanceJune 23, 20264 min read

Optimizing the Critical Request Chain: A Guide to HTTP/3 & Early Hints

Optimizing the Critical Request Chain is essential for web performance. Learn how to use HTTP/3 and Early Hints to slash network latency and boost speeds.

Read more
PerformanceJune 23, 20265 min read

Edge Caching with Surrogate Keys for Precise Cache Invalidation

Edge Caching performance relies on smart invalidation. Learn how to use Surrogate Keys to purge specific content without clearing your entire CDN cache.

Read more