Site search

Search IndexLane

Type at least two characters to search.

    Technical note

    Resource hints: when preload and preconnect help

    Check whether preload, prefetch, and preconnect improve page loading or compete with more important resources. Use network traces to decide what to keep.

    By NikoPublished November 19, 2026Read 4 min

    Resource hints can make a page faster when they start work the browser will need soon. They can also waste bandwidth on fonts, scripts, or images that are not needed yet. Check each hint against an actual network trace before adding more.

    The web.dev resource-hints guide explains the browser behaviour. These hints do not tell Google which pages to crawl first, and they cannot replace crawlable content and links.

    Choose the right hint

    HintBrowser behaviourGood use
    dns-prefetchResolves an origin's DNS earlyA likely third-party origin when preconnect is too costly
    preconnectStarts DNS, TCP, and TLS setupA critical cross-origin asset host
    preloadFetches a current-page resource at high priorityA genuinely critical font, image, style, or script
    modulepreloadFetches an ES module and dependencies earlyA critical module entry point
    prefetchFetches a likely future resource at low priorityA probable next navigation, when spare bandwidth exists

    Preloading several fonts, a below-the-fold image, and an analytics bundle makes them compete with the resources needed to display the first screen.

    Compare hints with the network trace

    This Python sample inventories hints and their declared resource type:

    from urllib.parse import urljoin
    
    import requests
    from bs4 import BeautifulSoup
    
    
    def audit_resource_hints(page_url):
        response = requests.get(page_url, timeout=10)
        response.raise_for_status()
        soup = BeautifulSoup(response.text, "html.parser")
    
        return [
            {
                "relation": link.get("rel", []),
                "resource": urljoin(page_url, link.get("href")),
                "as": link.get("as"),
                "media": link.get("media"),
            }
            for link in soup.find_all("link", href=True)
            if {"preload", "modulepreload", "prefetch", "preconnect", "dns-prefetch"}
            & set(link.get("rel", []))
        ]
    

    Compare the inventory with a browser network trace under a cold cache and realistic throttling. A useful preload should be consumed quickly by the page, use the correct as value, credentials mode, type, and media condition, and not trigger a duplicate download. An unused-preload warning is a concrete reason to remove or correct the hint.

    Preconnect only to origins needed early

    preconnect can help when the page must contact a separate origin early:

    <link rel="preconnect" href="https://cdn.example.com" crossorigin>
    

    Each preconnection uses sockets and cryptographic work, so limit it to the few origins involved in the initial render. dns-prefetch is a lighter fallback for less certain origins.

    In Blade, keep the list explicit rather than generating it from every asset found on the page:

    @foreach (['https://cdn.example.com'] as $criticalOrigin)
        <link rel="preconnect" href="{{ $criticalOrigin }}" crossorigin>
    @endforeach
    

    Preload only current-page essentials

    A preload should match the later request exactly, including URL, credentials mode, type, and media conditions:

    <link
        rel="preload"
        href="/fonts/main.woff2"
        as="font"
        type="font/woff2"
        crossorigin
    >
    

    Do not preload a resource merely because it is large or important somewhere on the site. If it is not required early on this page, let normal discovery and browser prioritisation handle it.

    Keep ordinary links and page content

    prefetch is not an internal-link substitute. Google discovers routes reliably from standard anchors with href values, not from a speculative fetch cache. A client-rendered card should still expose a real link:

    <a href="/products/wireless-headphones">Wireless headphones</a>
    

    Likewise, resource hints cannot compensate for an empty app shell whose primary copy appears only after a slow or failing API call. Use server rendering or static rendering for critical text and links when possible, then layer interaction on top.

    Measure before and after

    Use Lighthouse and browser developer tools to find unused preloads, duplicate transfers, render-blocking resources, and failed requests. Compare before and after traces; the presence of a hint is not evidence of a faster page. Then use Search Console's URL Inspection rendered HTML or an equivalent render test to confirm that primary content and crawlable links are present.

    Keep the same useful markup for visitors and crawlers. There is no documented fixed rendering allowance that resource hints can reserve for Googlebot.

    Related notes

    Check Brotli and gzip compression for crawler requests

    Verify compression negotiation, cache variation, and response size before assuming Brotli improves how your site serves crawlers.

    Read article →

    How to spot a crawl drop in server logs

    Compare verified crawler requests with your usual traffic pattern to catch access failures, rising errors, and unexpected URL changes.

    Read article →