How add headers to static assets?

I have tried _headers, functions, and _worker.js. They works only when there is no static assets matching the request URI. How to add headers to static assets?
7 Replies
mrparker
mrparker2y ago
it should be the path of the file - make sure the path is correct, and also make sure your _headers file is in the output directory
UlyssesZhan
UlyssesZhanOP2y ago
Yes, I make sure those are correct. Actually I know that because they are working, but only for those URIs that do not hit static assets.
nikhith_007
nikhith_0072y ago
@mrparker_lol i have the same issue, What do you mean by output folder? i use create-react-app do i need ot create build folder and then add _headers file?
mrparker
mrparker2y ago
the output folder is the folder that your assets are in for the pages site (look in build settings)
nikhith_007
nikhith_0072y ago
Assets, Js and Css files are inside the build folder
nikhith_007
nikhith_0072y ago
i use create-react-app
nikhith_007
nikhith_0072y ago
i have also created a build folder and pushed, not sure why it isn't working
Want results from more Discord servers?
Add your server