uses-text-compression
•
Savings: 65% - 85% file size reduction
How to Enable Text Compression (Gzip & Brotli) for Instant Loading
Text compression shrinks HTML, CSS, JavaScript, and SVG files before sending them over the network, drastically cutting download latency.
Technical Breakdown: What Causes This Issue?
Modern text compression algorithms like Brotli (`br`) and Gzip find repetitive patterns in code strings. A 500 KB uncompressed JavaScript bundle can be compressed down to 110 KB with Gzip, and under 85 KB with Brotli, downloading 4x faster on mobile networks.
How to detect if your page is affected:
- Lighthouse reports "Enable text compression" with potential byte savings.
- HTTP response headers lack `content-encoding: br` or `content-encoding: gzip`.
- CSS and JS files transfer at their full raw byte size in DevTools Network tab.
Step-by-Step Resolution Workflows
Enable Gzip/Brotli via your hosting cPanel (under "Optimize Website"), in your Nginx/Apache configuration, or route your domain through Cloudflare where Brotli compression is enabled with one click.
add_filter('script_loader_tag', function($tag, $handle) {
if (is_admin()) return $tag;
if (strpos($tag, 'defer') !== false) return $tag;
return str_replace(' src=', ' defer src=', $tag);
}, 10, 2);
Shopify automatically serves Brotli compression for assets stored on its CDN. If an external asset is reported, verify third-party script CDN endpoints support Brotli.
<script src="{{ 'theme.js' | asset_url }}" defer></script>
# Nginx configuration for Brotli & Gzip
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml+rss text/javascript image/svg+xml;
gzip_min_length 256;
# Brotli (if ngx_brotli is compiled)
brotli on;
brotli_comp_level 6;
brotli_types text/plain text/css application/json application/javascript text/xml application/xml+rss text/javascript image/svg+xml;
Frequently Asked Questions
Which is better: Gzip or Brotli?
Brotli is 15% to 25% more efficient than Gzip for HTML, CSS, and JS files, resulting in faster download times.
Does compressing images with Gzip help?
No! JPEGs, PNGs, and WebPs are already heavily compressed binary files. Trying to Gzip images actually wastes server CPU without saving bytes.
How do I verify if my site is using Brotli?
Inspect network headers in Chrome DevTools: look for `content-encoding: br` in the response headers of your HTML document.
Audit Your Live Website
Test if your domain passes this audit with sub-2s mobile loading:
Want guaranteed 90+ score without breaking anything?
Our senior performance engineers optimize your assets, configure server-level caching, and fix uses-text-compression with a 100% money-back guarantee in 48 hours.
Fix on WhatsApp (₹8,999)