Save the gziped and minified files

Could caddy save the gziped and minified files on the server (with a command line parameter!) ? This will be good for cpu performance.

I use this (bash script)

Original script is here:

Is there a strong need for Caddy to implement this functionality itself? What does it look like when you generate gzip files with a Caddy command vs. using a bash script?

It really looks to me like it’s the kind of thing you’d want to set up with a cron job or inotify-tools, or otherwise manage carefully yourself either way?

1 Like

I see, you are right. Its better to try minify cmd with gzip.

I wrote my own minify-cmd and called it gminzip:

1 Like

Caddy does a good job serving pre-compressed files efficiently. For every .css, .js, .html etc file, make sure there is a corresponding gz file too. Those users who can accept these compressed files (i.e. almost everybody) will get the pre-compressed files. This saves time: less disk i/o, less memory footprint, less network traffic; big win!

And the webserver CPU doesn’t do any of the hard work! Big win all round.

Ideally, you would not need to use the gzip module and would rely entirely on everything textual being pre-compressed by offline scripts etc. Obviously, for some situations, this ideal isn’t always possible, depending on circumstances. So the gzip module will remain as a useful second-best.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.