I was trying out R2 for Discourse compatibility, and it appears, that other than missing the necessary x-amz-acl (which I believe is already a priority for you to enable), it appears that R2 is ignoring the content encoding setting.
Examples:
https://pub-06c6437075be4b2c8d3405b133585da9.r2.dev/assets/activate-account-1ec10d89bce01387a7dec2a6b155cd3fe7bcc9258c065a79bf6a95fd232778f2.gz.js was uploaded with a gzip content encoding but there is no such header in the response.
Notably, R2 performs transparent decompression in a similar manner to Google Cloud Storage.
Depending on a variation of your request headers (i.e what encodings you accept) or how the object was stored (i.e if it has cache-control: no-transform), the object stored gzip’d in R2 might be decompressed on-the-fly as it’s returned to you.
This could explain why you’re not seeing it on your client.