I am unable to get this working. On a different web hosting service, I was able to set the Content-Encoding header to gzip, but I've looked everywhere and don't see a way to set headers on Heroku. The app is failing because the file isn't being decoded (it's a gzipped JSON file). I am looking at the network tab on Chrome and the response doesn't include the Content-Encoding header.
1 Answer
Heroku is an application host (a Platform as a Service), not a web host. The Heroku platform as such is not an HTTP server. Your application defines its own server infrastructure based on your source code, dependencies, Procfile, and the combination of buildpacks you select to run in Heroku.
The behavior of how your static files are served is defined by your application and you'll need to triage and resolve it based on the specific stack you are using. You won't be able to set headers in the Heroku platform itself.
-
Thanks. This is a front end React app built using create-react-app. Everything worked fine except this one thing. Could you point me in the right direction? How should I set these headers? Would I need to use this? github.com/mars/create-react-app-buildpack.– SRCPOct 8, 2021 at 14:40
-
I don't know; I am not a React developer. You might find more topical help on a forum that's devoted to that stack.– David Reed ♦Oct 8, 2021 at 14:43