You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a feature request I think can be very useful.
It seems "early hints" are gaining relevance lately to speed up page loads.
If I'm not wrong, currently, mod_http2 allows to set early hints only using static URLs, eg.: H2EarlyHints on H2PushResource /xxx.css
It would be great if we could set the parameter to the directive using a calculated environment variable, for example:
Calculate the env variable: SetEnvIf REQUEST_URI "^pagel\/(.*)$" EARLY_HINT_URL=/image/$1.jpg
Pass the env variable to H2PushResource: H2PushResource %{EARLY_HINT_URL}e
The text was updated successfully, but these errors were encountered:
maborec
changed the title
Use environment variables as paraters to directive 'H2PushResource'
Use environment variable as parameter to directive 'H2PushResource'
Apr 12, 2023
I like the idea. I am currently adding a H2EarlyHintLink directive that gets the complete content of a Link: header configured. Reason being that browser keep tweaking this header and I am not eager to follow any attribute change. So one can do
Now, mod_http2 could also auto-pick up such links from the environment. Let's say EARLY_HINT_LINK. But since there can be more than one, maybe all env vars matching EARLY_HINT_LINK* should be used?
this header field:
Link: <https://example.org/>; rel="start",
<https://example.org/index>; rel="index"
is equivalent to these:
Link: <https://example.org/>; rel="start"
Link: <https://example.org/index>; rel="index"
That means we (you :) ) can support one variable for full-featured implementation!
P.S. Please suggest, when H2EarlyHintLink will be released? Or may be i missed and this alredy done? Cant find reference in changelog... it wiil be cool to have full control this heading!
This is a feature request I think can be very useful.
It seems "early hints" are gaining relevance lately to speed up page loads.
If I'm not wrong, currently, mod_http2 allows to set early hints only using static URLs, eg.:
H2EarlyHints on
H2PushResource /xxx.css
It would be great if we could set the parameter to the directive using a calculated environment variable, for example:
Calculate the env variable:
SetEnvIf REQUEST_URI "^pagel\/(.*)$" EARLY_HINT_URL=/image/$1.jpg
Pass the env variable to H2PushResource:
H2PushResource %{EARLY_HINT_URL}e
As far as I have seen, this is not currently possible.
Taking a quick look at mod_include, I guess it could be done with something similar to include_expr_lookup in
https://github.com/omnigroup/Apache/blob/master/httpd/modules/filters/mod_include.c
...or maybe using the Apache expression parser, ap_expr.h.
The text was updated successfully, but these errors were encountered: