Skip to content

Commit 43a2d46

Browse files
committed
[WebLink] Fixed the preload links
1 parent ac90ac8 commit 43a2d46

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

web_link.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ correct prioritization and the content security policy:
6262

6363
<head>
6464
<!-- ... -->
65-
<link rel="stylesheet" href="{{ preload('/app.css', { as: 'style' }) }}">
65+
<link rel="preload" href="{{ preload('/app.css', { as: 'style' }) }}">
6666
</head>
6767

6868
If you reload the page, the perceived performance will improve because the
@@ -77,7 +77,7 @@ requested the HTML page.
7777

7878
<head>
7979
<!-- ... -->
80-
<link rel="stylesheet" href="{{ preload(asset('build/app.css')) }}">
80+
<link rel="preload" href="{{ preload(asset('build/app.css')) }}">
8181
</head>
8282

8383
Additionally, according to `the Priority Hints specification`_, you can signal
@@ -87,7 +87,7 @@ the priority of the resource to download using the ``importance`` attribute:
8787

8888
<head>
8989
<!-- ... -->
90-
<link rel="stylesheet" href="{{ preload('/app.css', { as: 'style', importance: 'low' }) }}">
90+
<link rel="preload" href="{{ preload('/app.css', { as: 'style', importance: 'low' }) }}">
9191
</head>
9292

9393
How does it work?
@@ -111,7 +111,7 @@ issuing an early separate HTTP request, use the ``nopush`` option:
111111

112112
<head>
113113
<!-- ... -->
114-
<link rel="stylesheet" href="{{ preload('/app.css', { as: 'style', nopush: true }) }}">
114+
<link rel="preload" href="{{ preload('/app.css', { as: 'style', nopush: true }) }}">
115115
</head>
116116

117117
Resource Hints
@@ -145,7 +145,7 @@ any link implementing the `PSR-13`_ standard. For instance, any
145145
<head>
146146
<!-- ... -->
147147
<link rel="alternate" href="{{ link('/index.jsonld', 'alternate') }}">
148-
<link rel="stylesheet" href="{{ preload('/app.css', { as: 'style', nopush: true }) }}">
148+
<link rel="preload" href="{{ preload('/app.css', { as: 'style', nopush: true }) }}">
149149
</head>
150150

151151
The previous snippet will result in this HTTP header being sent to the client:

0 commit comments

Comments
 (0)