Revela

Static Compression

Revela can pre-compress your static files with Gzip and Brotli for faster loading.

Do you need this? If you're using GitHub Pages, Netlify, Vercel, or Cloudflare Pages โ€“ no! These platforms compress automatically. This plugin is for self-hosted servers, AWS S3, or basic web hosts.

๐Ÿ“ฆ Pre-Generated

Compressed files created at build time, not on every request.

๐Ÿš€ 95% Smaller

HTML, CSS, and JS files compress dramatically with Brotli.

โšก Zero CPU Cost

Servers deliver pre-compressed files instantly.

Installation

revela plugin install Compress

Usage

Compress Your Site

# After generating your site
revela generate compress

Note: Compression runs separately, not as part of generate all. Your server must be configured to serve pre-compressed files.

Remove Compressed Files

revela clean compress

What Gets Compressed?

File Type Typical Savings
HTML 70-85%
CSS 75-90%
JavaScript 65-80%
JSON 70-85%
SVG 50-70%
XML 70-85%

Images are skipped โ€“ they're already optimized (AVIF, WebP, JPG).

Output Structure

Your files remain unchanged. Compressed versions are added alongside:

output/
โ”œโ”€โ”€ index.html          โ† Original (10 KB)
โ”œโ”€โ”€ index.html.gz       โ† Gzip (2.5 KB)
โ”œโ”€โ”€ index.html.br       โ† Brotli (2.1 KB)
โ”œโ”€โ”€ _assets/
โ”‚   โ”œโ”€โ”€ main.css
โ”‚   โ”œโ”€โ”€ main.css.gz
โ”‚   โ””โ”€โ”€ main.css.br

Example Output

โ•ญโ”€Successโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Compression complete!              โ”‚
โ”‚                                    โ”‚
โ”‚ Summary:                           โ”‚
โ”‚   Files:    14                     โ”‚
โ”‚   Original: 1.22 MB                โ”‚
โ”‚                                    โ”‚
โ”‚ Compressed sizes:                  โ”‚
โ”‚   Gzip:    93.4 KB (92.5% savings) โ”‚
โ”‚   Brotli:  61.6 KB (95.1% savings) โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

When Do You Need This Plugin?

Platform Need Plugin? Reason
GitHub Pages โŒ No Compresses automatically
Netlify โŒ No Compresses automatically
Vercel โŒ No Compresses automatically
Cloudflare Pages โŒ No Compresses automatically
AWS S3 + CloudFront ๐ŸŸก Optional CloudFront compresses, but pre-compressed is faster
AWS S3 (direct) โœ… Yes No automatic compression
nginx โœ… Yes Use gzip_static on for pre-compressed files
Apache โš™๏ธ Needs RewriteRule

Pipeline Order

Compression is not part of revela generate all. Run it separately after generating your site:

revela generate all
revela generate compress

This ensures all content exists before compressing.

Compression Settings

The plugin uses maximum compression for smallest files:

Format Level Browser Support
Gzip 9 (max) All browsers
Brotli 11 (max) Modern browsers (95%+)

Files under 256 bytes are skipped โ€“ compression overhead exceeds savings.