From: Stefan Eissing
+ PUSH might not always trigger the request/response/performance that one expects or + hopes for. There are various studies on this topic to be found on the web that explain + benefits and weaknesses and how different features of client and network influence + the outcome. For example: just because the server PUSHes a resource does not mean + a browser will actually use the data.
+The major thing that influences the response being PUSHed is the request that was
+ simulated. The request URL for a PUSH is given by the application, but where do the
+ request headers come from? For example, will the PUSH request a accept-language
+ header and if yes with what value?
Apache will look at the original request (the one that triggered the PUSH) and copy the
+ following headers over to PUSH requests: user-agent
, accept
,
+ accept-encoding
, accept-language
, cache-control
.
All other headers are ignored. Cookies will also not be copied over. PUSHing resources + that require a cookie to be present will not work. This can be a matter of debate. But + unless this is more clearly discussed with browser, let's err on the side of caution and + not expose cookie where they might oridinarily not be visible.
+ + +An alternative to PUSHing resources is to send Link
headers to the
+ client before the response is even ready. This uses the HTTP feature called "Early Hints" and
+ is described in RFC 8297.
In order to use this, you need to explicitly enable it on the server via
+(It is no on by default since some older browser tripped on such responses.)
+If this feature is on, you can the directive H2PushResource
to
+ trigger early hints and resource PUSHes:
This will send out a "103 Early Hints"
response to a client as soon
+ as the server starts processing the request. This may be much early than
+ the time the first response headers have been determined, depending on your web
+ application.
If H2Push
is enabled, this will also start the PUSH right after the
+ 103 response. If H2Push
is disabled however, the 103 response will be send
+ nevertheless to the client.