timberjack icon indicating copy to clipboard operation
timberjack copied to clipboard

Zstd support for rotated files

Open francislavoie opened this issue 1 year ago • 6 comments

Thanks for making this fork! We've been waiting a long time to see someone pick up the mantle, we're going to switch to this library in https://github.com/caddyserver/caddy

One old request was to add zstd support (alongside existing gzip support). See https://github.com/caddyserver/caddy/issues/5843

github.com/klauspost/compress/zstd can be used for this

francislavoie avatar Sep 06 '25 23:09 francislavoie

If you don't want to pull in an additional dependency (totally understandable), I think compression could be offloaded to the calling app, by having an interface that can be optionally plugged into timberjack config with a function that would be invoked whenever a file is being rotated, passing the filename, whether it "should be compressed" (based on its age), etc. We could return a byte stream and new filename or something like that.

francislavoie avatar Sep 07 '25 00:09 francislavoie

Hey @francislavoie i’m happy to contribute to Caddy — I’ll implement this request and start working on it.

DeRuina avatar Sep 09 '25 06:09 DeRuina

@francislavoie timberjack now supports zstd compression. Changes were merged here #43 . Thank you :)

DeRuina avatar Sep 19 '25 05:09 DeRuina

Thanks! We'll add support for that in this PR https://github.com/caddyserver/caddy/pull/7244

francislavoie avatar Sep 19 '25 06:09 francislavoie

I'm closing this issue since this was merged!

DeRuina avatar Oct 16 '25 05:10 DeRuina

Thanks, finally getting got around to implementing it in https://github.com/caddyserver/caddy/pull/7515

francislavoie avatar Feb 23 '26 07:02 francislavoie