Skip to content

Commit 29d1b38

Browse files
committed
Merge branch '3.4' into 4.3
* 3.4: Tweaks #12179 Add a note for preload asset
2 parents fc9fe33 + c637b7a commit 29d1b38

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)