Modern image file formats such as AVIF, JXL and WebP seem to be powerful, overcome previous formats and are recommended by search engines. But most CMS and related tools rarely support them. So I have the idea to provide such support at the Caddy level using an http handler module: Pixbooster
After a few days of work, I managed to create a first version which do not work too badly. As this is my first module for Caddy and my first project in Go, before going further, I would like to submit my work to your code review. All comments are welcome if kindly provided!
Thanks for your comments, @matt, as kind as always. I will make the suggested change.
Another question: the WebP library I’m using requires CGO_ENABLED=1 to compile. Is this a problem for distributing the module through the Caddy download page? I tried to find a library that didn’t require this, but couldn’t find any, except for bindings that require external libraries installed on the host.
I thought so. It’s a shame that WebP encoding support is so poorly implemented in Go. I think I’ll drop it. AVIF and JXL alone should make the trick.