@@ -50,20 +50,14 @@ Imagine that your application includes a web page like this:
50
50
</body >
51
51
</html >
52
52
53
- Following the traditional HTTP workflow, when this page is served browsers will
54
- make one request for the HTML page and another request for the linked CSS file.
55
- However, thanks to HTTP/2 your application can start sending the CSS file
56
- contents even before browsers request them.
57
-
58
- To do that, first install the WebLink component:
59
-
60
- .. code-block :: terminal
61
-
62
- $ composer require symfony/web-link
63
-
64
- Now, update the template to use the ``preload() `` Twig function provided by
65
- WebLink. The `"as" attribute `_ is mandatory because browsers need it to apply
66
- correct prioritization and the content security policy:
53
+ In a traditional HTTP workflow, when this page is loaded, browsers make one
54
+ request for the HTML document and another for the linked CSS file. However,
55
+ with HTTP/2, your application can send the CSS file's contents to the browser
56
+ before it requests them.
57
+
58
+ To achieve this, update your template to use the ``preload() `` Twig function
59
+ provided by WebLink. Note that the `"as" attribute `_ is required, as browsers use
60
+ it to prioritize resources correctly and comply with the content security policy:
67
61
68
62
.. code-block :: html+twig
69
63
0 commit comments