PageSpeed

PageSpeed: Enable Text Compression

Last updated: April 2026

Your server is sending HTML, CSS, and JS without gzip or brotli compression. Text files compress 60-80%, reducing transfer size and improving load times significantly.

Get your stack-specific fix โ†’

Fix for Nginx โ€” enable gzip

gzip on;
gzip_vary on;
gzip_comp_level 6;
gzip_types text/plain text/css application/json application/javascript
           text/xml application/xml application/xml+rss text/javascript
           image/svg+xml font/woff2;

Fix for Nginx โ€” enable brotli (better compression)

# Requires ngx_brotli module
brotli on;
brotli_comp_level 6;
brotli_types text/plain text/css application/json application/javascript
             text/xml application/xml image/svg+xml font/woff2;

Cloudflare

Dashboard โ†’ Speed โ†’ Optimization โ†’ Content Optimization โ†’ Brotli: On. Cloudflare compresses automatically when enabled.

Vercel

Vercel compresses responses automatically. No config needed.

Verify compression is working

curl -sI --compressed https://yoursite.com | grep -i content-encoding
# Should show: content-encoding: br (brotli) or gzip