# Loading

> Source: <https://webperf-snippets.net/Loading>

How a page loads, from the first byte of the HTML to the moment it can be used: the server response, what blocks rendering, scripts, CSS, fonts, resource hints, caching and the next navigations. Not sure where to start? [Which snippet should I use?](https://webperf-snippets.net/which-snippet.md) goes from the symptom you see.

- [Time to first byte](https://webperf-snippets.net/Loading/TTFB.md): Measures Time to First Byte, from the start of the navigation to the first byte of the HTML, which reflects the server response and the network.
- [First contentful paint (FCP)](https://webperf-snippets.net/Loading/FCP.md): Measures First Contentful Paint: when the browser renders the first text, image, canvas or SVG, the first sign for the user that the page is loading.
- [Client-side redirect detection](https://webperf-snippets.net/Loading/Client-Side-Redirect-Detection.md): Detects redirects made in JavaScript or by an SPA router, which add latency before the page renders and delay LCP, out of sight of most monitoring.
- [Back/forward cache (bfcache)](https://webperf-snippets.net/Loading/Back-Forward-Cache.md): Checks whether the page can be restored from the back/forward cache, which makes back and forward navigations instant, and what keeps it out.
- [JavaScript execution time breakdown](https://webperf-snippets.net/Loading/JS-Execution-Time-Breakdown.md): Splits the JavaScript time of the load into download and parsing, shows which scripts delay domInteractive, and flags code splitting opportunities.
- [Event processing time](https://webperf-snippets.net/Loading/Event-Processing-Time.md): Splits the navigation into its phases, from the redirects to the load event, to show where the loading time of the page goes.
- [Scripts loading](https://webperf-snippets.net/Loading/Script-Loading.md): Lists every script with its loading strategy, such as async, defer or blocking, and flags the ones that block the main thread and rendering.
- [First and third party script info](https://webperf-snippets.net/Loading/First-And-Third-Party-Script-Info.md): Lists the scripts of the page split into first party and third party, to show how much of the page depends on external code.
- [First and third party script timings](https://webperf-snippets.net/Loading/First-And-Third-Party-Script-Timings.md): Breaks the network timing of every script into its phases, DNS, connection and response, comparing first-party and third-party scripts.
- [Validate preload on async/defer scripts](https://webperf-snippets.net/Loading/Validate-Preload-Async-Defer-Scripts.md): Detects preloaded scripts that also use async or defer, an anti-pattern that raises the priority of code meant to load later.
- [Find render-blocking resources](https://webperf-snippets.net/Loading/Find-render-blocking-resources.md): Lists the stylesheets and scripts the browser must download and process before it renders anything, which delay FCP and LCP.
- [Resource hints](https://webperf-snippets.net/Loading/Resource-Hints.md): Lists the resource hints of the page, such as preload, prefetch, preconnect and dns-prefetch, and checks how each one is used.
- [Resource hints validation](https://webperf-snippets.net/Loading/Resource-Hints-Validation.md): Checks whether the page uses each preload, preconnect and dns-prefetch it declares, and finds the hints that waste connections and bandwidth.
- [Prefetch resource validation](https://webperf-snippets.net/Loading/Prefetch-Resource-Validation.md): Checks the prefetch hints of the page: how many, how large, of which type, and whether they compete with what the current page needs.
- [Priority hints audit](https://webperf-snippets.net/Loading/Priority-Hints-Audit.md): Audits fetchpriority on scripts, preloads, iframes and images, flags conflicts with preload, and finds an LCP image without fetchpriority=high.
- [Find above the fold lazy loaded images](https://webperf-snippets.net/Loading/Find-Above-The-Fold-Lazy-Loaded-Images.md): Finds lazy-loaded images inside the viewport, an anti-pattern that delays the images users see first, and often the LCP.
- [Find images with loading lazy and fetchpriority](https://webperf-snippets.net/Loading/Find-Images-With-Lazy-and-Fetchpriority.md): Detects images that have both loading="lazy" and fetchpriority="high" - a contradictory combination that indicates a misconfiguration.
- [Find non lazy loaded images outside of the viewport](https://webperf-snippets.net/Loading/Find-non-Lazy-Loaded-Images-outside-of-the-viewport.md): Finds images outside the viewport that load eagerly, spending bandwidth before the page needs them, as candidates for lazy loading.
- [Fonts preloaded, loaded, and used above the fold](https://webperf-snippets.net/Loading/Fonts-Preloaded-Loaded-and-used-above-the-fold.md): Compares the fonts the page preloads, the fonts it loads and the fonts it uses above the fold, to find wasted and missing preloads.
- [Webfont usage analyzer](https://webperf-snippets.net/Loading/Webfont-Usage-Analyzer.md): Checks each font face against the text that renders, and reports which faces are used, which downloaded for nothing and which never loaded.
- [Content visibility](https://webperf-snippets.net/Loading/Content-Visibility.md): Finds the elements that use content-visibility, warns when one lacks contain-intrinsic-size, and suggests offscreen sections that could use it.
- [Inline CSS info and size](https://webperf-snippets.net/Loading/Inline-CSS-Info-and-Size.md): Lists the inline style elements of the page with their size, to see how much CSS the HTML carries and whether inlining it pays off.
- [Inline script info and size](https://webperf-snippets.net/Loading/Inline-Script-Info-and-Size.md): Lists the inline script elements of the page with their size, to see how much JavaScript the HTML carries and what it costs the load.
- [CSS media queries analysis](https://webperf-snippets.net/Loading/CSS-Media-Queries-Analysis.md): Finds the @media rules for viewports wider than a breakpoint: CSS that phones download and parse without using, grouped by query and stylesheet.
- [CSS complexity](https://webperf-snippets.net/Loading/CSS-Complexity.md): Finds what the CSS of the page carries and can drop: images and fonts as data: URLs, @import chains, empty rules, unused @keyframes, complex selectors.
- [Critical CSS detection](https://webperf-snippets.net/Loading/Critical-CSS-Detection.md): Analyzes how the page loads its CSS: render-blocking stylesheets, their size against the 14 KB budget, and whether the critical CSS is inlined.
- [Get your \<head> in order](https://webperf-snippets.net/Loading/Get-Your-Head-in-Order.md): Checks the order of the elements in the head of the document: the browser processes them in sequence, so a poor order delays rendering.
- [SSR framework hydration data analysis](https://webperf-snippets.net/Loading/SSR-Hydration-Data-Analysis.md): Measures the hydration data that SSR frameworks such as Next.js, Nuxt and Remix serialize into the HTML for the browser to download and parse.
- [Service worker analysis](https://webperf-snippets.net/Loading/Service-Worker-Analysis.md): Analyzes the service worker of the page: its lifecycle, the resources it serves from cache, and the startup delay it can add to TTFB.
- [Cache strategy analysis](https://webperf-snippets.net/Loading/Cache-Strategy-Analysis.md): Audits the HTTP caching of every resource: missing or short cache lifetimes, anti-patterns and CDN cache hits, with a cache efficiency score.
- [Compression audit](https://webperf-snippets.net/Loading/Compression-Audit.md): Finds text resources served without gzip or brotli, such as scripts, stylesheets, JSON and SVG, and estimates the bytes compression would save.
- [Server-Timing and Early Hints viewer](https://webperf-snippets.net/Loading/Server-Timing-Early-Hints.md): Lists the Server-Timing metrics of the document and its resources and the 103 Early Hints timing, to see where the backend spends its time.
- [Speculation rules inspector](https://webperf-snippets.net/Loading/Speculation-Rules-Inspector.md): Inspects the speculation rules that prefetch and prerender the next navigations, and whether the current page was prerendered itself.
- [Third-party impact by domain](https://webperf-snippets.net/Loading/Third-Party-Impact-by-Domain.md): Groups third-party requests by domain with their count, bytes, render blocking and main-thread time, to show which third party to fix first.
