A performance budget turns vague goals such as “make the site faster” into checks your team can run before and after every release. This guide provides a copyable starting budget for JavaScript, CSS, images, fonts, requests, and total page weight, then shows how to connect those limits to Core Web Vitals and a repeatable frontend performance testing workflow.
Overview
A web performance budget is a set of limits for the resources and user-facing results that matter on a page. It can cover the size of the initial JavaScript bundle, the amount of CSS, image weight, font files, request count, page weight, and loading or responsiveness targets.
The purpose is not to make every page identical. A documentation page, product listing, and interactive application have different requirements. The purpose is to make trade-offs visible. If a new dependency adds 90 KB to the initial JavaScript, the team can decide whether that cost is justified instead of discovering the impact after deployment.
Use two kinds of budgets:
- Resource budgets: measurable limits for bytes, files, and requests.
- Experience budgets: targets for loading, visual stability, and interaction responsiveness.
Core Web Vitals are useful for the second category. Track the current Core Web Vitals guidance for loading performance, interaction responsiveness, and layout stability, and record the exact thresholds your project adopts. Standards and tooling can change, so do not treat a copied threshold as permanent.
A budget works best when it is attached to a specific page type and viewport. A mobile landing page on a slower connection may need a stricter initial payload than an authenticated dashboard used on managed desktop hardware.
How to estimate
Start with the page’s critical path: the resources required to render useful content and allow the primary action. Do not begin by adding every asset visible after scrolling. Separate the initial view from deferred content, because a page can have a large total footprint while still providing a fast initial experience—or a small total footprint that blocks rendering with a poorly ordered request.
- Choose a page type. Pick one representative route, such as a marketing page, article, search results page, or application shell.
- Choose test conditions. Record the browser, viewport, connection profile, cache state, geographic test location, and whether the test is a cold or repeat visit.
- Measure the current baseline. Capture transferred bytes, decoded image size, request count, JavaScript execution time, and Core Web Vitals data where available.
- Set a starting budget. Base it on the baseline, then remove unnecessary margin. A budget that is already far above current usage will not prevent regressions.
- Assign ownership. Make clear whether a failing check is handled by the frontend, design, content, platform, or release owner.
- Automate the easy checks. Run bundle, asset, request, and page-weight checks in continuous integration. Reserve field data and production monitoring for real-user confirmation.
Use this copyable starting template for a content-led page. It is a planning baseline, not a universal rule:
Performance budget: mobile initial view
JavaScript transferred: <= 170 KB
CSS transferred: <= 50 KB
Images in initial view: <= 500 KB
Web fonts: <= 100 KB
Initial document: <= 30 KB
Total initial transfer: <= 900 KB
Initial requests: <= 60
Third-party requests: <= 10
Lazy-loaded below-fold media: excluded from initial budget
Experience checks:
- Check current Core Web Vitals guidance for LCP, INP, and CLS
- Test a cold cache and a repeat visit
- Test the primary interaction, not only the first paint
- Record the slowest representative route, not just the homepage
Set a separate maximum for individual assets as well. For example, a single hero image or JavaScript chunk should not consume most of the entire page budget. Per-asset limits catch problems earlier than a total page-weight check.
Inputs and assumptions
A useful budget is only as reliable as the assumptions behind it. Put these inputs beside the budget in your repository or project documentation.
Page and audience
Identify the route, its main task, and the devices that matter. A page whose main conversion is a form submission should prioritize usable form interaction, while an editorial page should prioritize readable content and stable media.
Transfer size versus decoded size
Transfer size is what crosses the network after compression. Decoded size is what the browser holds after unpacking. Both matter: compression helps delivery, but large decoded JavaScript and images can still increase memory use, parsing, and rendering work.
Initial versus deferred resources
Label every asset as critical, conditionally loaded, or deferred. A carousel image that loads only after interaction should not be counted as an initial-view asset, but it still deserves a secondary budget and a test for the interaction that reveals it.
First-party and third-party code
Track analytics, advertising, chat, video, consent, and embedded widgets separately. A third-party script can affect network activity and main-thread work even when your build system does not control its contents. Set an explicit allowance and require a reason for adding a new provider.
Measurement quality
Lab tests are repeatable and useful for release checks. Field data reflects actual visitors and can expose device, network, and geographic conditions that a lab profile misses. Use both where possible, and keep test settings consistent so that changes are comparable.
For implementation details, pair this workflow with a responsive image strategy covering formats, dimensions, srcset, and lazy loading. Also review accessibility during optimization: removing motion, contrast, or usable keyboard behavior is not an acceptable performance win. The Responsive Image Optimization Reference and Web Accessibility Testing Workflow provide useful companion checklists.
Worked examples
Example 1: a landing page exceeds the JavaScript budget
Suppose the starting limit is 170 KB transferred for initial JavaScript, but the build produces 245 KB. A simple response is not always “remove 75 KB.” Inspect the bundle first. Separate code needed for the first interaction from code used by a menu, carousel, account panel, or below-fold component. Then consider route-level code splitting, tree shaking, replacing a large utility with a narrower import, and delaying nonessential initialization.
After the change, verify more than the bundle number. Confirm that the first interaction still works, that deferred code does not cause a visible delay, and that the browser performs less main-thread work. A smaller file that creates extra requests or expensive runtime work may not improve the user experience.
Example 2: images fit the byte budget but fail the visual budget
A page may remain below its 500 KB initial-image allowance while showing an oversized hero image on a small screen. Check intrinsic dimensions, responsive sources, compression, format choice, and whether the image has reserved layout space. Set width and height or an equivalent aspect-ratio rule so the image does not move surrounding content while loading.
Example 3: the lab report is good, but users report sluggish interaction
Investigate the interaction path rather than relying on page-load results. A heavy table, search filter, or checkout validation step may execute after the initial view. Profile the event, reduce unnecessary rendering, split work into smaller tasks, and test on a representative lower-powered device. Record the interaction as a separate acceptance check in the performance budget.
Keep performance changes traceable in version control. A branch and release checklist can require a budget comparison for any dependency, template, image, or third-party script change. The Git Branching and Release Checklist for Small Web Projects is a practical place to add that gate.
When to recalculate
Revisit the budget whenever the inputs change, not only when a formal performance incident occurs. Recalculate after a redesign, framework or dependency upgrade, new analytics or consent integration, image-library change, major content launch, or change in the devices and networks your audience uses.
Review it on a regular schedule as well. A six-month review is a reasonable maintenance interval, and an earlier review is appropriate after major browser, Core Web Vitals, build-tool, or measurement changes. At each review:
- Run the same lab tests used for the baseline.
- Compare production field data where it is available.
- Check whether the page’s primary task or audience has changed.
- Update the recorded Core Web Vitals guidance and test instructions.
- Remove obsolete allowances and document any approved exceptions.
- Open an issue for every failed limit, with an owner and review date.
For the next release, copy the template into the project, replace its assumptions with measured values, and add automated checks for the assets your team controls. Treat the budget as a decision tool: when a limit is exceeded, either reduce the cost, explain the trade-off, or revise the limit deliberately. That simple review habit makes performance part of the frontend workflow instead of a cleanup task at the end.