compression

Apply Gzip and Brotli compression to JavaScript assets in build pipelines.

235|25|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/PatternsDev/skills --skill compression-patternsdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compression
Source: https://github.com/PatternsDev/skills/tree/main/javascript/compression
Command: npx skills add https://github.com/PatternsDev/skills --skill compression-patternsdev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

JavaScript payloads are heavy and slow to download, which hurts page load times and user experience on slow networks. This Skill provides guidance on applying compression techniques to reduce transfer sizes and improve perceived performance.

Core Features & Use Cases

  • Guidance on when to apply Gzip vs Brotli for JavaScript assets.
  • Instructions on enabling static and dynamic compression at servers and CDNs, plus basic minification considerations.
  • Use Case: Decrease bundle size for production deployments to speed up initial render and improve Lighthouse scores.

Quick Start

Run Brotli and gzip compression as part of your production build to reduce JS payloads for faster load times.

Frequently Asked Questions about compression

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce JavaScript payload size for faster page loads?

Brotli and gzip are compression techniques used to shrink JavaScript payloads. Brotli achieves higher compression ratios for static assets, while gzip serves as a widely compatible fallback. Apply Brotli for modern browsers to maximize transfer size reduction and improve page performance.

What is the difference between static and dynamic compression for web assets?

Enable Brotli and gzip compression by configuring server and CDN settings to apply static pre-compression for build assets. For dynamic content, configure on-the-fly compression rules to ensure frequently changing JavaScript payloads are compressed during transfer.

Does Brotli work with all server and CDN configurations?

Brotli generally achieves better compression ratios than gzip for JavaScript assets, resulting in smaller payload sizes. Use Brotli for static build outputs to maximize performance gains, while retaining gzip as a fallback for broader browser compatibility.

When should I not use dynamic compression for JavaScript delivery?

Avoid dynamic compression for static JavaScript assets when you can pre-compress them during the build process. Dynamic compression adds server overhead for content that does not change, whereas static compression eliminates runtime CPU costs during deployment.