Documente Academic
Documente Profesional
Documente Cultură
httpd.apache.org
But, as RFC do, it's not really a good thing to read first. It's
1 of 12 12/4/18, 9:44 AM
HTTP/2 guide - Apache HTTP Server Version 2.4 about:reader?url=https://httpd.apache.org/docs...
Too Long, Didn't read: there are some new terms and
gotchas that need to be kept in mind while reading this
document:
2 of 12 12/4/18, 9:44 AM
HTTP/2 guide - Apache HTTP Server Version 2.4 about:reader?url=https://httpd.apache.org/docs...
While that should do the trick for most, they are people who
might prefer a statically linked nghttp2 in this module. For
3 of 12 12/4/18, 9:44 AM
HTTP/2 guide - Apache HTTP Server Version 2.4 about:reader?url=https://httpd.apache.org/docs...
Basic Configuration
4 of 12 12/4/18, 9:44 AM
HTTP/2 guide - Apache HTTP Server Version 2.4 about:reader?url=https://httpd.apache.org/docs...
Protocols http/1.1
<VirtualHost ...>
ServerName test.example.org
Protocols h2 http/1.1
</VirtualHost>
Protocols http/1.1 h2
5 of 12 12/4/18, 9:44 AM
HTTP/2 guide - Apache HTTP Server Version 2.4 about:reader?url=https://httpd.apache.org/docs...
There is one more thing to ordering: the client has its own
preferences, too. If you want, you can configure your server
to select the protocol most preferred by the client:
ProtocolsHonorOrder Off
makes the order you wrote the Protocols irrelevant and only
the client's ordering will decide.
A last thing: the protocols you configure are not checked for
correctness or spelling. You can mention protocols that do
not exist, so there is no need to guard Protocols with any
<IfModule> checks.
MPM Configuration
6 of 12 12/4/18, 9:44 AM
HTTP/2 guide - Apache HTTP Server Version 2.4 about:reader?url=https://httpd.apache.org/docs...
Clients
$ curl -V
curl 7.45.0 (x86_64-apple-darwin15.0.0)
7 of 12 12/4/18, 9:44 AM
HTTP/2 guide - Apache HTTP Server Version 2.4 about:reader?url=https://httpd.apache.org/docs...
Server Push
But there are restrictions: the client can disable this feature
8 of 12 12/4/18, 9:44 AM
HTTP/2 guide - Apache HTTP Server Version 2.4 about:reader?url=https://httpd.apache.org/docs...
and the server may only ever PUSH on a request that came
from the client.
The advantage for the client is that it saves the time to send
the request which may range from a few milliseconds to half
a second, depending on where on the globe both are
located. The disadvantage is that the client may get sent
things it already has in its cache. Sure, HTTP/2 allows for
the early cancellation of such requests, but still there are
resources wasted.
9 of 12 12/4/18, 9:44 AM
HTTP/2 guide - Apache HTTP Server Version 2.4 about:reader?url=https://httpd.apache.org/docs...
Link </xxx.css>;rel=preload;nopush
or you may disable PUSHes for your server entirely with the
directive
H2Push Off
The module will keep a diary of what has been PUSHed for
each connection (hashes of URLs, basically) and will not
PUSH the same resource twice. When the connection
closes, this information is discarded.
10 of 12 12/4/18, 9:44 AM
HTTP/2 guide - Apache HTTP Server Version 2.4 about:reader?url=https://httpd.apache.org/docs...
Early Hints
H2EarlyHints on
11 of 12 12/4/18, 9:44 AM
HTTP/2 guide - Apache HTTP Server Version 2.4 about:reader?url=https://httpd.apache.org/docs...
<Location /xxx.html>
H2PushResource /xxx.css
H2PushResource /xxx.js
</Location>
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.
12 of 12 12/4/18, 9:44 AM