Technical article
Performance budgets for websites and web applications
Set route budgets for bytes and user experience. Compare fixed conditions and assess exceptions with evidence.
- Performance
- Performance
- budgets
- websites
- applications

In this article
A performance budget is an agreed limit for a particular route and user context. Decide which risk to bound: excessive initial JavaScript, large images, slow main content or layout shifts. One score for the entire site cannot expose those trade-offs.
Define the measurement contract
- Route and task: for example, a mobile service page and access to contact.
- Conditions: viewport, network, CPU setting, browser and cold or warm cache.
- Metric: transferred bytes by resource type and relevant loading or stability measures.
- Decision: who reviews overruns and what evidence an exception requires.
Illustrative resource budget
[
{
"path": "/*",
"resourceSizes": [
{ "resourceType": "script", "budget": 80 },
{ "resourceType": "stylesheet", "budget": 60 },
{ "resourceType": "image", "budget": 400 },
{ "resourceType": "total", "budget": 700 }
]
}
]The numbers in this Lighthouse budget are fictional example limits in kilobytes, not Codegenie results or general standards. Resource budgets constrain size; timing and execution can still make equal bytes feel different. Verify that the runner actually reads this file and fails an overrun under the CI contract.
Example decision: adding a chat widget
A fictional service page has an agreed script limit. A widget exceeds it. First examine its visitor value, what may load before consent and whether on-demand loading suits the task. Compare the same page under identical conditions. Do not increase the limit solely to make a check pass.
Lab and field answer different questions
Use repeated lab runs for comparable changes and report median and spread. Field data describes real visits. Field INP is not a simulated click measurement; a Lighthouse run does not provide that real-use distribution. Missing field data remains a measurement limitation.
Maintain budgets during releases
Check the largest images, added scripts and external services on affected routes. Retain a baseline and document exceptions with purpose, measured impact and a review point. A budget should protect a concrete user action rather than defend an arbitrary number.
This sample budget has not been executed in a Lighthouse run. Check its format and integration with the runner actually installed.
Last updated:


