Skip to content

Commit d9b88d7

Browse files
committed
Add a note for preload asset
1 parent 6bea43f commit d9b88d7

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
@@ -66,6 +66,17 @@ If you reload the page, the perceived performance will improve because the
6666
server responded with both the HTML page and the CSS file when the browser only
6767
requested the HTML page.
6868

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

0 commit comments

Comments
 (0)