Add possibility to send early hints headers
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 https://github.com/nginx/nginx/pull/326
You'd be able to do it using add_header in the location that has js_content at least if/when this merged.
So earlyhints, has been release in mainline, my understand is that actually this is not possible via add_header X-Foo foo early;, but only if setted by the backend response.
my goal is to send earlyhints via NJS, **before** connecting to the proxy.
I can't find a way to achieve this (using js_content or else) is it actually possible or needs enhancements on njs?
regards