encodeBodysubdomain-dev.example.com for your R2 bucket testing instead of dealing with r2.dev?encodeBody since if you omit that when sending a response that has content-encoding: gzip then you run into the same double compression issue

encodeBodyencodeBodysubdomain-dev.example.comcontent-encoding: gzip