From e7c1b3e5e2c374b7ff3def38292625950b3e8313 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Sun, 23 Feb 2025 16:00:39 -0500 Subject: [PATCH] Add new config option --- ctx.go | 1 + middleware/static/static.go | 1 + 2 files changed, 2 insertions(+) diff --git a/ctx.go b/ctx.go index 3af6b600..aecfacdc 100644 --- a/ctx.go +++ b/ctx.go @@ -1555,6 +1555,7 @@ func (c *DefaultCtx) SendFile(file string, config ...SendFile) error { AcceptByteRange: cfg.ByteRange, Compress: cfg.Compress, CompressBrotli: cfg.Compress, + CompressZstd: cfg.Compress, CompressedFileSuffixes: c.app.config.CompressedFileSuffixes, CacheDuration: cfg.CacheDuration, SkipCache: cfg.CacheDuration < 0, diff --git a/middleware/static/static.go b/middleware/static/static.go index 7afc7798..e9101cd0 100644 --- a/middleware/static/static.go +++ b/middleware/static/static.go @@ -66,6 +66,7 @@ func New(root string, cfg ...Config) fiber.Handler { AcceptByteRange: config.ByteRange, Compress: config.Compress, CompressBrotli: config.Compress, // Brotli compression won't work without this + CompressZstd: config.Compress, // Zstd compression won't work without this CompressedFileSuffixes: c.App().Config().CompressedFileSuffixes, CacheDuration: config.CacheDuration, SkipCache: config.CacheDuration < 0,