@@ -10,30 +10,22 @@ W3C's `Resource Hints`_, the WebLink component
1010brings great opportunities to boost webapp's performance.
1111
1212Thanks to WebLink, HTTP/2 (**h2 **) servers are able to push resources to clients
13- before they even know that they need them (thinkto CSS or JavaScript
13+ before they even know that they need them (thinkabout CSS or JavaScript
1414files, or relations of an API resource). WebLink also enables other very
15- efficient optimisations that work with HTTP 1:
15+ efficient optimisations that work with HTTP 1.x :
1616
1717- telling the browser to fetch or to render another webpage in the
1818 background ;
19- -init early DNS lookups, TCP handshakes or TLS negotiations
19+ -initializing early DNS lookups, TCP handshakes or TLS negotiations
2020
21- Let's discover how easy it is to use it and the real life benefits you
22- can expect.
23-
24- To benefit from HTTP/2 Server Pushes, a HTTP/2 server and a HTTPS connection
25- are mandatory (even in local).
21+ To benefit from HTTP/2 Server Pushes, an HTTP/2 server and an HTTPS connection
22+ are required (even local ones).
2623Both Apache, Nginx and Caddy support these protocols.
2724Be sure they are properly configured before reading.
2825
2926Alternatively, you can use the `Docker installer and runtime for
3027Symfony `_ provided by Kévin Dunglas (community supported).
3128
32- It includes everything you need to run Symfony
33- (PHP:doc: `configured properly for Symfony </performance >`, and Composer)
34- as well as a development reverse proxy (Apache) supporting HTTP/2 Server Push
35- and HTTPS (most clients only support HTTP/2 over TLS).
36-
3729Unzip the downloaded archive, open a shell in the resulting directory and run
3830the following command:
3931
@@ -65,7 +57,7 @@ Now, download Bootstrap_, extract the archive and copy the file
6557``dist/css/bootstrap.min.css `` in the ``public/ `` directory of our
6658project.
6759
68- Symfony comes with a `nice integrationwith of the most popular CSS framework `_.
60+ Symfony comes with a `nice integration of the most popular CSS framework `_.
6961
7062..note ::
7163
@@ -75,8 +67,9 @@ Symfony comes with a `nice integration with of the most popular CSS framework`_.
7567
7668Now, it's time to create the template of our homepage:
7769
78- ..code-block ::html
70+ ..code-block ::twig
7971
72+ {# templates/homepage.html.twig #}
8073 <!DOCTYPE html>
8174 <html>
8275 <head>
@@ -104,7 +97,7 @@ And finally, register our new template as the homepage using the builtin
10497_controller :' Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction'
10598template :' homepage.html.twig'
10699
107- Refresh your browser, thisnice homepage should appear:
100+ Refresh your browser, this homepage should appear:
108101
109102..image ::/_images/components/weblink/homepage-requests.png
110103
@@ -142,21 +135,21 @@ responses have been sent directly by the server.
142135
143136..note ::
144137
145- Google Chrome providesa nice interface to debug HTTP/2 connections.
138+ Google Chrome providesan interface to debug HTTP/2 connections.
146139 Open ``chrome://net-internals/#http2 `` to start the tool.
147140
148141How does it works?
149142~~~~~~~~~~~~~~~~~~
150143
151- The WebLink component tracks Link HTTP headers to add to the response.
144+ The WebLink component tracks`` Link `` HTTP headers to add to the response.
152145When using the ``preload() `` helper, a ``Link `` header
153146with a `preload `_
154147``rel `` attribute is added to the response:
155148
156149..image ::/_images/components/weblink/response-headers.png
157150
158151According to `the Preload specification `_,
159- whena HTTP/2 server detects that the original (HTTP 1) response
152+ whenan HTTP/2 server detects that the original (HTTP 1.x ) response
160153contains this HTTP header, it will automatically trigger a push for the
161154related file in the same HTTP/2 connection.
162155The Apache server provided in the Docker setup supports this feature.
@@ -183,7 +176,7 @@ known issues, cache implications and the state of the support in popular
183176browsers.
184177
185178In addition to HTTP/2 Push and preloading, the WebLink component also
186- provide some helpers to send `Resource
179+ provides some helpers to send `Resource
187180Hints <https://www.w3.org/TR/resource-hints/#resource-hints> `__ to
188181clients, the following helpers are available:
189182