Neova高级 SEO 平台

未启用文本压缩

在 Neova 中 直接在抓取过程中运行,无需任何设置。

规则最近审核:2026年10月17日 · 指南更新:2026年9月28日

HTML、CSS、JavaScript 和其他文本文件在发送时没有压缩,传输量因此比所需的更大、更慢。Lighthouse 只判断 HTML 文档;把它的估算用于网站的其他文本文件是产品惯例。

您可以做什么

在服务器或 CDN 上为 HTML、CSS、JavaScript、JSON、SVG 和 XML 响应启用 gzip 或 Brotli。

Neova 如何发现

Neova 对每类页面抽样运行速度测试。

Neova 为何标记

  • 未压缩的文本文件往往比使用 gzip 或 Brotli 时大好几倍,下载耗时更长,在移动端尤其如此。
  • 所有现代浏览器和 Google 的爬虫都支持压缩,所以几乎没有理由不开启。
  • Lighthouse 评估的是 HTML 文档;把它的估算套用到网站的其他文本文件上,是本产品的惯例。

来源

生成的工单

这一部分目前只有英文版。

PE-013 · Text Compression Is Not Enabled

How to Check the Fix: 1. Run the check again in Neova
2. Spot-check sample URLs across affected templates
3. Record the re-check date and period label next to the baseline

Neova writes this ticket for every affected page group and sends it to Jira, Linear, Asana and the rest, after you approve it.

完整指南

这一部分目前只有英文版。

What "Enable Text Compression" Means

This check fires when your server sends text-based files — HTML, CSS, JavaScript, SVG, JSON — without a Content-Encoding header, meaning they travel the wire uncompressed. Text compresses beautifully (often 70–90% smaller), so shipping it raw wastes bandwidth and delays first paint. The stakes land squarely on Core Web Vitals: a bloated main document pushes back Largest Contentful Paint, and on mobile connections that delay is measured in whole seconds.

A Real Example: Seeing the Header

The whole thing hinges on one response header. A compressed response looks like this:

$ curl -I -H "Accept-Encoding: gzip, br" https://example.com/style.css

HTTP/2 200
content-type: text/css
content-encoding: br          ← compression is ON (Brotli here)
vary: Accept-Encoding

If content-encoding is missing entirely, the file went out raw and the check fails. The fix is to turn compression on at the server. On Apache with mod_deflate:

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css text/javascript 
    application/javascript application/json image/svg+xml
</IfModule>

On Nginx, enable gzip (and Brotli if the module is compiled in):

gzip on;
gzip_comp_level 5;
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
gzip_vary on;

Brotli vs. gzip: What to Reach For

gzip Brotli (br)
Typical text savings ~70% ~75–80% (better)
Browser support Universal All modern browsers, HTTPS only
CPU cost to compress Low Higher at max levels
Best for static assets Fine Pre-compress at level 11 once
Best for dynamic HTML Level 5–6 Level 4–5 (balance CPU)
Fallback — Serve gzip if client sends no br

Ship Brotli to clients that advertise it and fall back to gzip for the rest. The Vary: Accept-Encoding header keeps proxies and CDNs from caching the wrong version.

How to Detect It on Your Own Site

  1. curl -I (the fastest check): Run curl -I -H "Accept-Encoding: gzip, br" https://yoursite.com/ and look for a content-encoding line. No line means no compression.
  2. Lighthouse: DevTools → Lighthouse → Performance. "Enable text compression" appears under Opportunities with the estimated KB and time savings per file.
  3. PageSpeed Insights: Run the URL through PageSpeed Insights — the same opportunity lists every uncompressed resource.
  4. DevTools Network tab: Load the page, click a CSS or JS request, and compare "Size" (transferred) against "Content" (uncompressed). If they are identical, that file was not compressed.

Why the Wire Size, Not the Disk Size, Is What Hurts

A 120 KB JavaScript bundle sitting on your server costs nothing until someone requests it. The moment they do, that 120 KB has to cross the network — and on a mid-tier mobile connection, that transfer alone can take the better part of a second before the browser has even started parsing. Compression attacks exactly this stretch of the timeline. Gzip or Brotli can turn that 120 KB into roughly 30 KB on the wire, and because the browser decompresses in a few milliseconds, the user gets the full file far sooner with no visible cost. The main HTML document is the highest-value target of all: it is the very first thing requested, and until it arrives nothing else can even be discovered, so compressing it directly shortens the critical path to first paint.

This is why compression is one of the highest leverage single toggles in performance work. It touches every text asset at once, it requires no code changes, and it compounds with every other optimization you make. A minified stylesheet that is also compressed is smaller than either technique achieves alone, and the savings apply on every request, for every visitor, forever.

How to Fix It

  1. Flip it on at the server. Apache: enable mod_deflate or mod_brotli. Nginx: set gzip on and add the Brotli module. This is the durable fix.
  2. Let the CDN do it. Cloudflare, Fastly, and most CDNs compress at the edge with a single toggle — often the quickest win if you cannot touch server config.
  3. WordPress on shared hosting: Many caching plugins expose a "gzip compression" switch; enabling it writes the right .htaccess rules for you.
  4. List every text type. A common miss is compressing HTML but forgetting JSON, SVG, or web-font formats — add them to the MIME list.
  5. Re-test with curl. Confirm the content-encoding header appears on each flagged file type, not just the homepage.

False Positives and Gotchas

Do not try to compress images with gzip — JPEG, PNG, and WebP are already compressed, and running them through gzip wastes CPU for zero gain. That belongs to image encoding, a different check. Also watch for a CDN that strips or overrides your origin's encoding; if curl shows compression at the origin but not at the public URL, the edge is the culprit. And if Lighthouse still complains after you enabled it, you are likely testing a cached response — purge and retest.

FAQ

Will Compression Slow Down My Server?

Barely, and it is a trade you want. Compressing HTML at gzip level 5–6 costs a millisecond or two of CPU to save tens of kilobytes over the wire. For static assets, pre-compress once at build time and the runtime cost is zero.

Is Text Compression the Same as Minification?

No. Minifying CSS and minifying JavaScript rewrite the file to remove whitespace; compression wraps whatever bytes you send in gzip or Brotli on the wire. Do both — minify first, then compress the minified output for the biggest reduction.

Do I Need to Compress Images Too?

Not with gzip. Images need format-level optimization — serving WebP or AVIF and encoding efficiently — not text compression.

I Enabled It but the Check Still Fails. Why?

Usual suspects: a CDN caching the pre-fix uncompressed version, a MIME type you forgot to add to the list, or the Accept-Encoding request header being stripped by a proxy. Curl each file type directly to isolate where the header disappears.

Does Compression Help SEO Directly?

Indirectly but meaningfully — smaller responses mean faster loads, and page speed feeds Core Web Vitals, which is a ranking signal. See our guide on improving page speed on WordPress.

在您自己的网站上找到它

Neova 在每次抓取时都会运行此检查项和其他所有检查项,然后把修复方法写成工单交给您的团队。

  • 适用于 Mac、Windows 和 Linux 的桌面应用
  • 全部 696 项检查,每项都附来源
  • Search Console 和 Analytics 4,以只读方式连接
  • 工单发送到 Jira、Linear 和 Asana

下载 Neova Desktop Free 套餐,或免费试用 Solo 14 天,无需银行卡。

全部性能检查 · 指南 · 检查项库

作者:Neova Labs · 返回检查项库