Can't configure custom header

I want to configure custom response headers for my website. But things aren’t going as intended. I want my to configure custom header for bundle.js file and all files inside images folder. The bundle js file and images directory are in the dist directory which I have deployed. In my netlify.toml file I have done this

for = "/bundle.js"
    cache-control = "max-age=31536000"

for = "/images/*"
    cache-control = "max-age=31536000"

But this doesn’t work.

Hi @Nakib, welcome to the Community!

You’ll want to make sure that the headers are capitalized, like so: Cache-Control. Let me know if that helps.

1 Like

Thanks @Dennis, It works. I have one more query. https is enabled on my site. Does that means my site using http/2 or I need to enable it manually?

HTTP/2 is enabled by default on HTTPS connections. But do note that while most HTTP/2 features like multiplexing is supported, server push is not.