@@ -59,7 +59,8 @@ correct prioritization and the content security policy:
5959
6060 <head>
6161 <!-- ... -->
62- <link rel="preload" href="{{ preload('/app.css', { as: 'style' }) }}">
62+ <link rel="preload" href="{{ preload('/app.css', {as: 'style'}) }}" as="style">
63+ <link rel="stylesheet" href="/app.css">
6364 </head>
6465
6566If you reload the page, the perceived performance will improve because the
@@ -74,7 +75,8 @@ requested the HTML page.
7475
7576 <head>
7677 <!-- ... -->
77- <link rel="preload" href="{{ preload(asset('build/app.css')) }}">
78+ <link rel="preload" href="{{ preload(asset('build/app.css')) }}" as="style">
79+ <!-- ... -->
7880 </head>
7981
8082Additionally, according to `the Priority Hints specification `_, you can signal
@@ -84,7 +86,8 @@ the priority of the resource to download using the ``importance`` attribute:
8486
8587 <head>
8688 <!-- ... -->
87- <link rel="preload" href="{{ preload('/app.css', { as: 'style', importance: 'low' }) }}">
89+ <link rel="preload" href="{{ preload('/app.css', {as: 'style', importance: 'low'}) }}" as="style">
90+ <!-- ... -->
8891 </head>
8992
9093How does it work?
@@ -108,7 +111,8 @@ issuing an early separate HTTP request, use the ``nopush`` option:
108111
109112 <head>
110113 <!-- ... -->
111- <link rel="preload" href="{{ preload('/app.css', { as: 'style', nopush: true }) }}">
114+ <link rel="preload" href="{{ preload('/app.css', {as: 'style', nopush: true}) }}" as="style">
115+ <!-- ... -->
112116 </head>
113117
114118Resource Hints
@@ -142,7 +146,8 @@ any link implementing the `PSR-13`_ standard. For instance, any
142146 <head>
143147 <!-- ... -->
144148 <link rel="alternate" href="{{ link('/index.jsonld', 'alternate') }}">
145- <link rel="preload" href="{{ preload('/app.css', { as: 'style', nopush: true }) }}">
149+ <link rel="preload" href="{{ preload('/app.css', {as: 'style', nopush: true}) }}" as="style">
150+ <!-- ... -->
146151 </head>
147152
148153The previous snippet will result in this HTTP header being sent to the client:
0 commit comments