Seoxpert.io
mediumPerformance

Text Resources Served Without Compression (gzip / br)

Some scripts and stylesheets are served without gzip or Brotli compression, increasing load times and bandwidth usage.

By Seoxpert Editorial · Published

Why it matters

Uncompressed HTML, CSS, and JS files are much larger, causing slower page loads and higher data usage for users. This negatively affects Core Web Vitals like LCP and TBT, potentially lowering search rankings and user satisfaction.

Impact

Leaving this unresolved results in slower site performance and possible SEO penalties due to poor Core Web Vitals.

How it's detected

Automated crawlers request text resources with 'Accept-Encoding: gzip, br' and check for the 'Content-Encoding' header in the response.

Common causes

  • CDN compression settings disabled or misconfigured
  • Origin server not configured to compress text resources
  • Custom server overrides default CDN compression
  • Legacy server software lacking compression support

How to fix it

Enable gzip and Brotli compression at your CDN or server. For Nginx, use 'gzip on;' and specify text resource types. On platforms like Vercel, Netlify, or Cloudflare, ensure you haven't overridden default compression. Test with 'curl -H "Accept-Encoding: gzip, br" -I <url>' and verify the 'Content-Encoding' header is present.

Code examples

Nginx: Enable gzip compression for text resources

gzip on;
gzip_types text/css application/javascript application/json;

Test compression with curl

curl -H "Accept-Encoding: gzip, br" -I https://example.com/script.js
# Look for 'Content-Encoding: gzip' or 'Content-Encoding: br' in the response headers.

FAQ

How do I know if my resources are being compressed?

Use curl or browser dev tools to check for the 'Content-Encoding' header in resource responses.

Why are my resources uncompressed if my CDN should handle it?

A custom server config or misconfigured origin may override the CDN's default compression settings.

Should I enable both gzip and Brotli?

Yes, enable both. Brotli is preferred by modern browsers, but gzip ensures compatibility with older clients.

Does compression affect all file types?

Compression is most effective for text-based files like HTML, CSS, and JS. Images and binaries are usually already compressed.

Found this issue on your site?

Run a scan to see if Text Resources Served Without Compression (gzip / br) affects your pages.

Scan my website →