mirror of
https://github.com/symfony/symfony-docs.git
synced 2026-03-24 00:32:14 +01:00
Add a note for preload asset
This commit is contained in:
11
web_link.rst
11
web_link.rst
@@ -66,6 +66,17 @@ If you reload the page, the perceived performance will improve because the
|
||||
server responded with both the HTML page and the CSS file when the browser only
|
||||
requested the HTML page.
|
||||
|
||||
.. note::
|
||||
|
||||
You can preload an asset by wrapping it with the ``preload()`` function
|
||||
|
||||
.. code-block:: html+twig
|
||||
|
||||
<head>
|
||||
{# ... #}
|
||||
<link rel="stylesheet" href="{{ preload(asset('build/app.css')) }}">
|
||||
</head>
|
||||
|
||||
Additionally, according to `the Priority Hints specification`_, you can signal
|
||||
the priority of the resource to download using the ``importance`` attribute:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user