Skip to content
StaticScope
Overview
Get StaticScope

Set a performance budget

Choose a per-page weight you can defend, measure it from the static build and decide what gets cut when a page goes over.

Build & performance Updated 21 November 2026 6 min read

A performance budget is a number you agree before you’re attached to a design. Without one, every asset argument is a matter of taste, and the page grows one reasonable decision at a time. With one, you can point at the page and say it’s over.

The static build gives you the measurement for free. You don’t need a synthetic test to know a page is carrying 400 KB of JavaScript. You need to decide what you’ll accept, then look at the numbers after each build.

Budget the page, not the folder

Total folder size is a hosting number, not a user experience. A site with 300 MB of video that nobody autoplays is fine. A site with a 1.5 MB article is not. Set the budget per page type: home, post, archive, landing page. A landing page with a hero video and a post with a featured image shouldn’t share a target.

Budget the first visit with an empty cache. That’s the number the build can measure, and it’s the one a new visitor pays. Returning visitors get a better deal because CSS, fonts and scripts are cached. Optimising for the repeat visit hides the cost you’re trying to control.

What to count

  • HTML. The page itself, including inline CSS, JSON and scripts.
  • CSS. Every stylesheet the page loads, plus what those stylesheets pull in through @import.
  • JavaScript. Every script the page loads, minus the third-party tags the build can’t see.
  • Fonts. Every font file named by a stylesheet the page loads. The estimate counts all formats, even though the browser picks one.
  • Images. The image sources and background images. Not the alternative sizes in a srcset.

Add third parties on top, manually. Analytics, chat, consent, embeds and remote fonts don’t appear in the build and don’t count in page size. A page that passes a 1 MB budget with 600 KB of tag manager attached hasn’t passed anything.

Starting budgets

These are starting points, not laws. They assume a content site, a mostly text-and-images page and a first visit. Adjust for what you publish, then hold the line for a quarter before moving it.

AssetStarting budgetWhy
HTML100 KBEnough for a rich page with inline styles and JSON. Past this, the template is carrying markup for elements that are not on the page.
CSS100 KBA theme plus a couple of plugins can hit 300 KB without anyone noticing. Above 100 KB you’re usually shipping component rules the page never matches.
JavaScript200 KBRoughly 60–70 KB compressed, but significant parsing work. jQuery, a slider and a lightbox will get you there on their own.
Fonts100 KBTwo or three WOFF2 files. Every extra weight is another 20–40 KB, and most sites use two weights at most.
Images500 KBThe usual biggest line. A hero, a card image and a logo should fit. A 4 MB hero will not.
Whole page1 MBA target you can defend without pretending every site is the same. Photography-heavy pages may need 1.5 MB; text pages should beat 1 MB comfortably.

The numbers are uncompressed build bytes. That matches what StaticScope measures. Your host should compress text with gzip or Brotli, which typically removes 60–75% of HTML, CSS and JavaScript. Images and fonts are already compressed and barely move. So 400 KB of text might arrive as 120–160 KB, while the whole page lands around 700–800 KB. Treat that as a rough conversion, not a promise.

If 1 MB feels arbitrary, derive the first budget from your current site. Take the median page size, cut 20% and give yourself a quarter to reach it. That’s less satisfying than a round number and more likely to survive contact with a content team.

Measuring from the build

Start with the heaviest pages, not the average. The average hides the template that’s three times too big.

wp staticscope files --type=html --orderby=page_size --limit=20
wp staticscope files --type=css --limit=50
wp staticscope files --type=js --limit=50
wp staticscope files --type=fonts --limit=50

Pick one page from each template: a post, an archive, the home page, a landing page. Open its detail and read the breakdown. If images are 70% of the page, a JavaScript diet won’t help. If scripts are 50%, resizing the hero is a distraction.

For the shared assets, sort by used on. A 150 KB stylesheet on every page is a 150 KB tax on every budget. A 150 KB stylesheet on one landing page is a decision about that page. Both can be fine; they’re different problems.

After publishing, check what the host sends. The build size is the input; compression is the host’s job:

curl -sI -H 'Accept-Encoding: br,gzip' https://example.com/ | grep -i content-encoding

If there’s no content-encoding, your 100 KB stylesheet is arriving as 100 KB. Fix that before you spend a week deleting 20 KB files.

Where budgets go wrong

  • Per-asset budgets with no page budget. You can pass every category and still ship 3 MB, because nothing adds them up.
  • Mixing units. A compressed budget checked against uncompressed build sizes will always look like a failure, or always look fine. Pick one.
  • Forgetting third parties. The build excludes them. Add them by hand or the budget is fiction.
  • No owner. A budget nobody enforces is a suggestion. Decide who says no, and when.
  • Measuring once. Assets creep back with the next plugin. Check at each release or once a month.
  • Punishing shared files twice. A cached stylesheet counts in full on every page estimate. That’s right for a first visit and wrong for a repeat one.

Deciding what gets cut

Work in this order: delete, defer, shrink, replace, accept. Delete what nothing uses. Defer what isn’t needed for first paint. Shrink images and fonts. Replace a heavy library with something native. Accept what’s left, with a reason written down.

Which category to attack first depends on the page. Images win on bytes. JavaScript wins on main-thread time. CSS wins on first paint, because it blocks rendering. If the page is 1.8 MB and 1.2 MB is images, start there. If it’s 900 KB and 500 KB is scripts, the images can wait.

Every cut needs a check on the preview, as well as a smaller number. Deferring the wrong script can break a menu; removing a font weight can change a heading’s look on one template. The budget is there to make the trade-off explicit, not to make it for you.

Keep it in the loop

Build, sort the pages, compare against the budget, fix one thing, rebuild. StaticScope keeps the last build only, so keep a note of the numbers or the ZIP if you need a record. Compare the same page and the same type breakdown each time.

Don’t block a release over 5%. Do block it over a page that doubled because someone added a slider and a font. The budget’s job is to make that visible while it’s still straightforward to undo.

Page size is not a speed score. It ignores request count, connection setup, server response, third parties and CPU time. Use it as a weight budget, then measure real performance with Lighthouse or WebPageTest against the deployed site.

Next