I’m serving my next.js assets through spaces but the Response Headers don’t have a Content-Encoding header. I’ve confirmed the headers are set in the spaces file metadata. I tried precompressing and uploading my files to spaces but still no header.
Does DO spaces/CDN not support Content-Encoding?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hi there,
As far as I can see, according to DigitalOcean’s documentation, the Spaces CDN endpoints may dynamically uncompress content if the original object has
Content-Encoding: gzip
and the client does not send anAccept-Encoding: gzip
header.If the CDN does decompress the content dynamically, it will remove the
Content-Encoding: gzip
header from the response.You can find more information about this here:
Basically, if you’ve set the
Content-Encoding
header in your file metadata and it’s not appearing as expected, the CDN may not be altering or adding headers dynamically, which could be why you’re not seeing it in the response.I believe that as of the time being, there is no way to force this.
Best,
Bobby