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 4fc31c8

Browse filesBrowse files
dunglasjaviereguiluz
authored andcommitted
[WebLink] Add an example using Priority Hints
1 parent 18836b8 commit 4fc31c8
Copy full SHA for 4fc31c8

File tree

Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Filter options
Expand file treeCollapse file tree

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
@@ -66,6 +66,16 @@ 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+
Additionally, according to `the Priority Hints specification`_, you can signal
70+
the priority of the resource to download using the ``importance`` attribute:
71+
72+
.. code:: twig
73+
74+
<head>
75+
{# ... #}
76+
<link rel="stylesheet" href="{{ preload('/app.css', { importance: 'low' }) }}">
77+
</head>
78+
6979
.. tip::
7080

7181
Google Chrome provides an interface to debug HTTP/2 connections. Browse
@@ -163,6 +173,7 @@ You can also add links to the HTTP response directly from controllers and servic
163173
.. _`Resource Hints`: https://www.w3.org/TR/resource-hints/
164174
.. _`Docker installer and runtime for Symfony`: https://github.com/dunglas/symfony-docker
165175
.. _`preload`: https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content
176+
.. _`the Priority Hints specification`: https://wicg.github.io/priority-hints/
166177
.. _`the Preload specification`: https://www.w3.org/TR/preload/#server-push-(http/2)
167178
.. _`Cloudflare`: https://blog.cloudflare.com/announcing-support-for-http-2-server-push-2/
168179
.. _`Fastly`: https://docs.fastly.com/guides/performance-tuning/http2-server-push

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.