File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -50,14 +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- You can update the template to use the ``preload() `` Twig function provided by
59- WebLink. The `"as" attribute `_ is mandatory because browsers need it to apply
60- 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:
6161
6262.. code-block :: html+twig
6363
You can’t perform that action at this time.
0 commit comments