Skip to main content

Resource Prioritization Foundation

Browsers do not load a webpage linearly from top to bottom; they analyze the HTML and prioritize resources based on perceived necessity. Resource prioritization is how you influence that queue so the browser spends bandwidth and CPU on the above-the-fold experience first.

Core Idea

Prioritization is about controlling the Critical Rendering Path. By deferring non-essential JavaScript and preloading critical above-the-fold assets, you clear the network and CPU queue, dramatically improving LCP and INP.

Core Concepts: Resource Loading Phases

PhaseDescriptionWordPress Examples
CriticalMust load before the first visual paint; affects LCP directlyHero image, above-the-fold web font, base CSS
High PriorityNeeded quickly after the first paintNavigation JavaScript, font fallbacks
Medium PriorityFunctional, but not urgent for the initial viewScroll animations, secondary interactive buttons
Low PriorityCan load late or only on user interactionChat widgets, comment systems, 3rd-party trackers

Typical Problems Without Prioritization

ProblemSymptomRoot Cause
Render-blocking CSSBlank white screen for 2–3 secondsHeavy theme stylesheets loaded synchronously in <head>
Delayed interactionHigh INP/TBTLarge JS bundles executed before the user can interact
Layout shiftsHigh CLSFonts or images loading late and pushing text down
Unused assetsBloated page sizePlugins aggressively enqueuing scripts globally

Why Use Perfmatters

While caching plugins handle the server side, a plugin like Perfmatters gives you surgical control over frontend resource delivery:

FeatureBenefit
Delay JavaScriptEliminates TBT/INP delays by holding third-party scripts until user interaction.
Script ManagerUnload unnecessary JS/CSS on a per-page or post-type basis (e.g., unloading form CSS on the homepage).
Preload AssetsInstructs the browser to prioritize the LCP hero image and critical fonts.
Disable Core BloatStrips out WordPress defaults like emojis and dashicons, saving ~50–100 KB per page.
Local Google FontsRemoves the external DNS lookup and allows font preloading.

Implementation Philosophy

  1. Less is More: Load only what is needed, precisely where it is needed.
  2. Surgical Control: Use the Script Manager to unload assets at the page/template level, rather than relying on global toggles.
  3. Defer vs Delay: Use defer for essential functional JS (like mobile menus). Use delay strictly for third-party or below-the-fold scripts.
  4. Preload Selectively: Preload the LCP image and exactly one or two critical fonts. Overloading the preload queue defeats its purpose.
  5. Audit Plugin Enqueues: Assume every new plugin will load its assets globally until proven otherwise.

Strategy: Delay and unload aggressively.

Reason: Content-focused pages are heavily cached and require minimal JavaScript to function. You can delay almost all JS.

Baseline Metrics to Watch

MetricTarget
LCP< 2.5s (ideally < 1.8s for static)
INP< 200ms
CLS<= 0.1
JS Payload< 150 KB initial, < 300 KB total
CSS Payload< 75 KB critical, < 150 KB total

Troubleshooting Matrix

SymptomMetric AffectedLikely CauseFix
Blank screen on loadLCPRender-blocking stylesGenerate Critical CSS; defer main stylesheet
Button clicks delayedINPMain thread blocked by JSDelay third-party JS; defer theme scripts
Text shifts after loadCLSFonts swapping latePreload local fonts; use font-display: swap
Page size remains hugeTotal BytesGlobal plugin bloatUse Script Manager to unload unused assets

Quick Lab

Perfmatters Configuration Lab
  1. Install Perfmatters and enable Delay JS.
  2. Add a heavy third-party script (like Google Analytics) and verify it does not load until you move the mouse.
  3. Enable the Script Manager and navigate to your homepage. Unload a plugin's CSS (e.g., Contact Form 7) specifically for the homepage.
  4. Enable Local Google Fonts and set the primary heading font weight to preload.
  5. Run PageSpeed Insights and measure the reduction in JavaScript execution time and improvement in LCP.

Cheat Sheet

View Cheat Sheet
DoDon't
Delay non-critical third-party JSDon't load everything synchronously in <head>
Preload only the hero image and critical fontDon't preload all assets blindly
Use Script Manager to unload by post typeDon't globally disable scripts without testing
Defer mobile menu and toggle JSDon't delay core interactivity scripts
Lazy-load embeds and below-fold imagesDon't auto-load third-party media on page load
Summary

Mastering resource prioritization flips the browser's default behavior from "load everything now" to "load only what the user sees first." This is the key to passing Core Web Vitals on mobile devices.

What's Next