Bunny.net's auto-compression compresses files on their servers as they leave, not on your computer

Bunny.net offers automatic compression through their Bunny Optimizer feature, which compresses may be able to access files (mostly text-based: HTML, CSS, JavaScript, JSON, XML) as they travel from Bunny's servers to your visitors' browsers. You don't compress files yourself — Bunny does it in real time when someone requests them. This happens only if you enable it in your account settings and the file type supports compression.

The compression happens at Bunny's edge servers, which means your original files stay unchanged on your storage. Visitors with browsers that support compression (nearly all modern ones do) receive smaller files, which load faster. Visitors with older browsers get the uncompressed version automatically.

This is different from manually compressing files before upload — it's a service Bunny runs on your behalf, and it requires no work from you once turned on.

Key Takeaways

  • Bunny Optimizer compresses text-based files like HTML, CSS, and JavaScript automatically when visitors request them, without you uploading compressed versions.
  • You enable compression in your Bunny.net dashboard under Optimizer settings, and it applies to all may be able to access files in that pull zone.
  • Compression only works for file types Bunny supports — images, videos, and already-compressed files are skipped automatically.
  • Visitors see smaller file sizes and faster load times, but the feature requires no setup on your end beyond flipping the toggle.

Where to find and enable Bunny Optimizer in your dashboard

Log into your Bunny.net account and go to the pull zone you want to compress. In the left sidebar, click Optimizer. You'll see a toggle for Gzip Compression and another for Brotli Compression. Turn on whichever you want — Brotli compresses more aggressively but requires more recent browsers, while Gzip works on nearly everything.

Most users turn on both. Bunny automatically sends Brotli to browsers that support it and falls back to Gzip for older ones. If you turn on only Gzip, all visitors get that version regardless of what their browser can handle.

The setting takes effect immediately. You don't need to re-upload files or wait for a cache clear — Bunny begins compressing on the next request.

Which file types get compressed and which don't

Bunny compresses text-based files: HTML, CSS, JavaScript, JSON, XML, SVG, and plain text. These types compress well because they contain a lot of repeated characters and patterns.

Bunny does not compress images (JPEG, PNG, WebP, GIF), videos (MP4, WebM), audio files, PDFs, or files already compressed like ZIP archives. Attempting to compress these again wastes processing power and usually makes files slightly larger, so Bunny skips them. If you upload a file with a custom MIME type, Bunny may not recognize it — you can manually set MIME types in your pull zone settings if needed.

You can see which files are being compressed by checking your analytics or by inspecting the response headers in your browser's developer tools — look for Content-Encoding: gzip or Content-Encoding: br.

How compression affects your bandwidth and storage

Compression reduces the amount of data Bunny sends to visitors, which lowers your bandwidth bill. A typical HTML page compresses to 20–30% of its original size; CSS and JavaScript often compress to 30–40%. The savings add up quickly if you serve a lot of traffic.

Compression does not affect your storage — your files stay the same size on Bunny's servers. Bunny compresses only the copy sent to the visitor's browser, then discards it. Your original files are never modified.

The compression itself uses a small amount of CPU on Bunny's edge servers, but this is included in your plan and not billed separately. For most sites, the bandwidth savings far outweigh the tiny processing cost.

Troubleshooting compression when files aren't getting smaller

If you've enabled compression but files still seem large, check that the file type is one Bunny compresses. Open your browser's developer tools (F12 in most browsers), go to the Network tab, reload the page, and click on a file. Look at the Response Headers — if you see Content-Encoding: gzip or Content-Encoding: br, compression is working. If you don't see that header, the file type isn't may be able to access.

If compression is enabled but the header is missing, clear your browser cache and reload. Sometimes your browser holds onto an old cached version. If it still doesn't appear, the file may be served from a different pull zone or your Optimizer setting may not have saved — go back to the dashboard and confirm the toggle is on.

Very small files (under a few kilobytes) sometimes aren't worth compressing, and Bunny may skip them. This is normal and doesn't indicate a problem.

Combining Bunny compression with your own file optimization

Bunny's compression works alongside your own optimization, not instead of it. If you minify your CSS and JavaScript before uploading (removing unnecessary spaces and comments), Bunny compresses the minified version, making it even smaller. The two approaches complement each other.

You can minify files using tools like UglifyJS for JavaScript, cssnano for CSS, or build tools like Webpack or Gulp. Many static site generators (Hugo, Jekyll, Next.js) minify automatically. After minifying, upload as normal — Bunny will compress on top of that.

Image optimization (resizing, converting to WebP, reducing quality) is separate from Bunny's compression and is worth doing independently. Bunny doesn't optimize images, only compress text files.

Frequently Asked Questions

Does Bunny compression work on cached files?

Yes. Bunny compresses files whether they're fresh from origin or served from cache. The compression happens at the edge server just before sending to the visitor, so cache status doesn't matter.

Can I compress specific files and leave others uncompressed?

No. Optimizer settings apply to the entire pull zone. If you need fine-grained control, you'd have to use separate pull zones for different content types, which is usually not worth the complexity.

What's the difference between Gzip and Brotli compression?

Brotli compresses more aggressively (files are 10–20% smaller) but requires modern browsers. Gzip is older and works on nearly everything. Turning on both lets Bunny pick the best option for each visitor automatically.

Does compression slow down my site?

No. The compression happens on Bunny's servers, not your visitor's browser. Files arrive smaller and load faster. The CPU cost to Bunny is negligible and included in your plan.

Will compression break my website?

No. Bunny only compresses file types that are safe to compress, and browsers automatically decompress them. Your site works exactly the same — just faster.