10000 Merge branch '7.2' into 7.3 · symfony/symfony-docs@dfeaef1 · GitHub
[go: up one dir, main page]

Skip to content

Commit dfeaef1

Browse files
committed
Merge branch '7.2' into 7.3
* 7.2: [WebLink] Minor reword remove installation repetition in weblink
2 parents be8b28f + e7fdf18 commit dfeaef1

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

web_link.rst

+8-14
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,14 @@ Imagine that your application includes a web page like this:
5050
</body>
5151
</html>
5252

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:
6761

6862
.. code-block:: html+twig
6963

0 commit comments

Comments
 (0)
0