Gzip encoding in upstream or Caddy?

Sorry I deleted the template as this is a theoretical question.

I use a nice little app written in Go for microblogging and links shares that runs with an old school CGI script.

So I set up an Apache container in Docker for the CGI script. My Caddy 2 (in a Docker container too) does the reverse proxy to Apache. This set-up works fine.

Since the app serves static assets in xml, I will add a gzip compression on-the-fly.

My question is: is there a good practice regarding who handles the gzip compression? Caddy or the upstream?

For the sake of simplicity, I would rather encode in Caddy (i.e. less instructions in Apache, deactivation of the deflate module) but I would like to hear some feedback/opinion on this issue.

There’s no harm in having it on both. If content is already encoded, Caddy won’t re-encode it.

I don’t think it makes much of a difference though, you’ll hardly notice unless you’re optimizing for scale.

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