Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 051178e

Browse filesBrowse 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
Copy full SHA for 051178e

File tree

1 file changed

+11
-0
lines changed
Filter options

1 file changed

+11
-0
lines changed

‎web_link.rst

Copy file name to clipboardExpand all lines: web_link.rst
+11Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.