Uncompressed CSS and JS: assets served without gzip
Large text sub-resources served with no Content-Encoding, while the HTML around them is compressed. squirrel checks every crawled asset.
What asset compression is
Server configuration usually compresses text/html and stops there. The MIME types a page spends most of its bytes on, text/css and application/javascript, have to be listed separately in nginx gzip_types or Apache AddOutputFilterByType, and it is easy to ship a site where the document is compressed and everything it loads is not.
The saving on text is large enough that this is worth checking separately from the document. Brotli beats gzip on text and every current browser accepts it; zstd and the shared-dictionary codings are newer and also count.
What squirrel checks
The rule runs once per crawl over the CSS, image and script resources the crawl collected. Images are included because SVG lands in that pool and is text. It emits one check named asset-compression:
- Skipped with the message
No sub-resources were crawledwhen the crawl collected none. - Skipped with the message
No compressible text assets with observed response headerswhen none of them can be judged. - Passing with the message
All N compressible asset(s) are compressed or under 100.0 KB. - Warning with the message
N text asset(s) over 100.0 KB served without compression, the expectationgzip, Brotli, or zstd on every large text asset, and one item per asset, largest first.
An asset is judged only when its status was 2xx, it recorded no error, it was fetched on this run rather than reused from a cached record, its content encoding was observed on that fetch, and its content type is compressible. Those exclusions are the point: a record with no observed encoding cannot prove the server sent none, and reporting on it would invent a finding. Any declared coding counts as compressed, so a coding newer than this rule is never reported as uncompressed. identity, including a list of nothing but identity tokens, means no coding and does count.
On a local or private-network host, such as localhost or 192.168.1.10, the rule is skipped and left out of the score, because a dev server is not the production edge. See Transport and delivery rules do not apply.
How to fix it
gzip_types text/css application/javascript image/svg+xml application/json;
brotli_types text/css application/javascript image/svg+xml application/json;Behind a CDN, check that compression is enabled for static file extensions rather than only for documents. The default on some configurations covers HTML alone.
There is no common false positive. The rule stays silent rather than judging an asset whose response headers it did not observe on this run.
| Rule ID | perf/asset-compression |
| Category | Performance |
| Scope | Site-wide |
| Severity | warning |
| Weight | 6/10 |
Options
| Option | Type | Default | Description |
|---|---|---|---|
min_bytes | number | 102400 (100 KB) | Only report uncompressed assets larger than this many bytes |
Configuration example
[rules."perf/asset-compression"]
min_bytes = 102400Enable / disable
Disable this rule
[rules]
disable = ["perf/asset-compression"]Disable all Performance rules
[rules]
disable = ["perf/*"]Enable only this rule
[rules]
enable = ["perf/asset-compression"]enable replaces the default ["*"], so this is the only rule selected. Leave disable out: a rule that matches any disable pattern is skipped even when enable names it. Only an enabled setting under a rule’s own [rule_options] table overrides both lists.
Related rules
- perf/compression: the same question asked of the HTML document itself.
- perf/css-file-size: the size of those stylesheets before compression.
- perf/js-file-size: the same for scripts.
- perf/bad-caching: compression coverage across every crawled document.
Performance findings ship in every audit next to the SEO, security and agent experience rules. See Core Web Vitals for how an agent works through a report.
References
Check your site
Run squirrel audit https://example.com and open the Performance section of the report. Every uncompressed asset is listed with its size, largest first. Signed-out local audits need no account and cost nothing. Signed-in audits spend credits.