Skip to content

Add possibility to send early hints headers #896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jaysee opened this issue Apr 24, 2025 · 1 comment
Open

Add possibility to send early hints headers #896

jaysee opened this issue Apr 24, 2025 · 1 comment
Labels

Comments

@jaysee
Copy link

jaysee commented Apr 24, 2025

It would be a great thing to be able to send HTTP 103 headers aka early hints using njs, actually, tryed using

r.headersOut['Link'] = '</style.css>; rel=preload; as=style';
r.headersOut['Link'] = '</script.js>; rel=preload; as=script';

r.return(103, "");

in js_content or when setting a variable with js_var...

but got error curl: (92) HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)

makes sens, so needs internal support for this?

regards

@jaysee jaysee added the feature label Apr 24, 2025
@jo-carter
Copy link
Contributor

@jaysee
nginx/nginx#326

You'd be able to do it using add_header in the location that has js_content at least if/when this merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants