First off, thank you for the Netlify starter plan, it’s a super helpful product!
I’ve seen older issues about this, but I thought I’d post a newer one. I’m fairly certain that setting headers in netlify.toml did not do anything. Putting this in
[[headers]] for = "/static/*" [headers.values] x-test-header = 'foobar'
did not set the header for paths under /static/. I also tried setting a
cache-control header and that did not work either. On the Netlify deploy page, it said:
No header rules processed
This deploy did not include any header rules. Learn more about headers.
However, I know that the netlify.toml file at the root of the repository is working because I see log messages like:
Different build dir detected, going to use the one specified in the Netlify configuration file: 'site' versus '' in the Netlify UI
I then switched to a
_headers file in the publish directory and that worked as expected. Putting this in
/static/* x-test-header: foobar
correctly set the header on static/ paths.
Given that the _headers file is working, I can work with that. However, I just thought I’d let you know that there is definitely a bug somewhere.
I’m not comfortable sharing my Netlify site publicly, but in case it helps, here are some current X-NF-Request-ID’s that you could use to find the project and its history?
Note that these are current request IDs and I’ve already switched to the _headers file, so the headers work as expected for these request IDs.