Performance Auditor — checks whether the HTML document and every referenced stylesheet and script are served minified, reporting one result per resource.
Performance
Minified assets are smaller, download faster and parse quicker, which improves Largest Contentful Paint and Time to Interactive.
Per resource
Every evaluated resource gets its own check, so you can see exactly which file still ships unminified.
<link href="*.css">) and scripts (<script src="*.js">) it references, fetches each one and scores it with a set of minification heuristics. Each resource produces exactly one check: FAIL when it is not minified, WARNING when it could not be fetched, or SUCCESS when it is minified.
How it works
- Fetch the page — requests the audited URL (redirects followed). A network failure or non-2xx status produces an
ERRORresponse and nothing else is evaluated. - Discover resources — extracts every
<link>whosehrefends in.cssand every<script>whosesrcends in.js; HTML entities in the attribute (&) are decoded and relative URLs are resolved against the page URL. - Fetch resources — downloads each stylesheet and script concurrently (up to 10 at a time, 30-second timeout per resource).
- Score minification — for every fetched body at or above
minSizeBytes, measures average line length, whitespace ratio, structure density (tags, rules or statements per line) and comment ratio. Each signal that crosses its threshold scores one point; a resource is considered minified when it scores at least 2 of 4. Smaller bodies are not scored: minifying a few hundred bytes saves nothing, and the heuristics cannot tell a one-statement file from a pretty-printed one. - Aggregate — any unminified resource makes the audit
FAIL; otherwise any unreachable resource makes itWARNING; when every resource is minified the audit isSUCCESS.
Preferences
An invalid value (missing, negative, fractional, non-numeric) makes the auditor fall back to the default and log a warning.
What it audits
Every row maps to onecheckRule* method and one CheckCode. CheckCode suffixes use status ranges: 200 success, 300–399 warning, 400–499 fail, 500–599 error. Rules 400–402 and 300–301 run once per resource, so a page with three unminified scripts yields three 402 checks. The 200 check is likewise emitted once per minified resource rather than once per audit.
Every
FAIL and SUCCESS message quotes the observed metrics, for example: Stylesheet /css/site.css is not minified: 214 line(s) averaging 23 characters, 28.4% whitespace, 3.1% comments (minification score 0/4, minimum 2).
Output documentation
Risks and considerations
Unminified assets cost every visitor bytes and CPU
- Whitespace, comments and long identifiers can add 30–60% to the transfer size of CSS and JavaScript, even after gzip or Brotli compression.
- Larger scripts take longer to parse and compile on the main thread, which delays interactivity most on low-end mobile devices.
- Shipping unminified builds to production usually means a development build was deployed, which can also leak source comments and debug code.
Heuristic detection
- Minification is inferred from line length, whitespace, structure density and comment ratio; it is not a byte-for-byte comparison with a minifier’s output.
- Very small files (a few lines) can be judged either way; treat a single borderline result with some care and look at the metrics in the check data.
What this auditor does not check
- Only
<link href="*.css">and<script src="*.js">references are discovered; stylesheets or scripts served from URLs without those extensions,@imported CSS, dynamically injected scripts and module preloads are not evaluated. - Inline
<style>and<script>blocks are scored only as part of the HTML document. - Resources are fetched without the page’s Basic Auth credentials, so protected assets report
300. - Compression (gzip, Brotli) is covered by the Content Encoding Auditor, not by this one.