10000 Merge branch '4.3' into 4.4 · symfony/symfony-docs@051178e · GitHub
[go: up one dir, main page]

Skip to content

Commit 051178e

Browse files
committed
Merge branch '4.3' into 4.4
* 4.3: Tweaks #12179 Add a note for preload asset
2 parents 8b223d4 + 29d1b38 commit 051178e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

web_link.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ If you reload the page, the perceived performance will improve because the
6969
server responded with both the HTML page and the CSS file when the browser only
7070
requested the HTML page.
7171

72+
.. note::
73+
74+
You can preload an asset by wrapping it with the ``preload()`` function:
75+
76+
.. code-block:: html+twig
77+
78+
<head>
79+
<!-- ... -->
80+
<link rel="stylesheet" href="{{ preload(asset('build/app.css')) }}">
81+
</head>
82+
7283
Additionally, according to `the Priority Hints specification`_, you can signal
7384
the priority of the resource to download using the ``importance`` attribute:
7485

0 commit comments

Comments
 (0)
0