Priority hints for resource loading priority management

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Implementing Priority Hints for Resource Loading

Browser sets loading priorities itself, and most times does it correctly. But there are scenarios where heuristics fail: LCP image loads with low priority because it's in carousel and browser doesn't know it's critical. Or analytics script gets high priority and delays rendering. Priority Hints—fetchpriority attribute—allow correcting these decisions.

How Browser Sets Priorities Without Hints

Chrome uses five priority levels: Highest, High, Medium, Low, Lowest. By default:

  • CSS in <head> — Highest
  • Sync scripts in <head> — High
  • Images — Low (except first in viewport — Medium)
  • Async/defer scripts — Low
  • Fetch API — High
  • XHR — High

Problem: browser doesn't always know which image is LCP element. If <head> has <link rel="preload"> for image—it gets High. But this only speeds download, not render priority.

fetchpriority Syntax

Attribute accepts three values: high, low, auto (default).

<!-- Raise priority of LCP image -->
<img src="/hero.webp" fetchpriority="high" alt="Hero">

<!-- Lower priority of decorative images below fold -->
<img src="/decoration.webp" fetchpriority="low" alt="">

<!-- Lower priority of non-critical script -->
<script src="/analytics.js" defer fetchpriority="low"></script>

<!-- In preload directive -->
<link rel="preload" href="/hero.webp" as="image" fetchpriority="high">

In Fetch API:

// Critical data request for first render
const data = await fetch('/api/initial-data', { priority: 'high' });

// Background sync
const sync = await fetch('/api/sync-status', { priority: 'low' });

Scenario: Image Carousel

Without hints browser doesn't know first carousel slide is LCP element. Loads all slides with same priority.

<div class="carousel">
  <!-- First slide — LCP, high priority -->
  <img
    src="/slides/slide-1.webp"
    fetchpriority="high"
    loading="eager"
    alt="Slide 1"
  >

  <!-- Other slides — low priority or lazy -->
  <img
    src="/slides/slide-2.webp"
    fetchpriority="low"
    loading="lazy"
    alt="Slide 2"
  >
</div>

Scenario: Product Page with Gallery

<!-- Main image — LCP -->
<img
  src="/products/main-image.webp"
  fetchpriority="high"
  loading="eager"
  width="800"
  height="600"
  alt="Product"
>

<!-- Thumbnails — low priority -->
<div class="thumbnails">
  <img src="/products/thumb-1.webp" fetchpriority="low" loading="lazy" alt="">
</div>

Dynamic Priority Management in React

When LCP element is determined dynamically:

function ProductGrid({ products }) {
  return (
    <div className="grid">
      {products.map((product, index) => (
        <ProductCard
          key={product.id}
          product={product}
          imagePriority={index === 0 ? 'high' : 'low'}
          imageLoading={index < 4 ? 'eager' : 'lazy'}
        />
      ))}
    </div>
  );
}

function ProductCard({ product, imagePriority, imageLoading }) {
  return (
    <div>
      <img
        src={product.image}
        fetchpriority={imagePriority}
        loading={imageLoading}
        alt={product.name}
      />
    </div>
  );
}

In Next.js <Image> component uses priority prop:

import Image from 'next/image';

// Automatically adds fetchpriority="high" and preload
<Image
  src="/hero.webp"
  width={1200}
  height={600}
  priority
  alt="Hero"
/>

Lower Priority for Third-Party Scripts

Analytics and pixels shouldn't compete with critical resources:

<!-- With explicit low priority: -->
<script src="https://www.google-analytics.com/analytics.js" defer fetchpriority="low"></script>

<!-- GTM with low priority -->
<script fetchpriority="low">
  (function(w,d,s,l,i){/* GTM snippet */})(window,document,'script','dataLayer','GTM-XXXXX');
</script>

Critical API Requests During SSR Hydration

For hydration needing immediate data:

async function loadCriticalData(url) {
  const response = await fetch(url, {
    priority: 'high',
    cache: 'no-cache',
  });
  return response.json();
}

async function syncUserPreferences() {
  await fetch('/api/preferences', {
    method: 'POST',
    priority: 'low',
    body: JSON.stringify(preferences),
  });
}

Measuring Effect

Check via Chrome DevTools → Network → Priority column. Before and after fetchpriority placement check:

  1. What priority LCP image loads with
  2. Whether third-party scripts displace critical resources

Programmatically via PerformanceResourceTiming:

const observer = new PerformanceObserver((list) => {
  for (const entry of list.getEntries()) {
    if (entry.initiatorType === 'img' && entry.name.includes('hero')) {
      console.log({
        url: entry.name,
        ttfb: entry.responseStart - entry.fetchStart,
        duration: entry.duration,
      });
    }
  }
});
observer.observe({ type: 'resource', buffered: true });

Browser Support

fetchpriority supported in Chrome 101+, Edge 101+, Firefox 132+, Safari 17.2+. For older browsers—simply ignored, graceful degradation.

Timeframe

Audit current priorities via DevTools and place fetchpriority on key elements — 4–8 hours. Full implementation with dynamic priority management in React — 1–2 business days.