File tree 1 file changed +3
-1
lines changed
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ To do that, first install the WebLink component:
55
55
$ composer require symfony/web-link
56
56
57
57
Now, update the template to use the ``preload() `` Twig function provided by
58
- WebLink:
58
+ WebLink. The `"as" attribute `_ is mandatory because browsers need it to apply
59
+ correct prioritization and the content security policy:
59
60
60
61
.. code-block :: html+twig
61
62
@@ -174,6 +175,7 @@ You can also add links to the HTTP response directly from controllers and servic
174
175
.. _`Resource Hints` : https://www.w3.org/TR/resource-hints/
175
176
.. _`Docker installer and runtime for Symfony` : https://github.com/dunglas/symfony-docker
176
177
.. _`preload` : https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content
178
+ .. _`"as" attribute` : https://w3c.github.io/preload/#as-attribute
177
179
.. _`the Priority Hints specification` : https://wicg.github.io/priority-hints/
178
180
.. _`the Preload specification` : https://www.w3.org/TR/preload/#server-push-(http/2)
179
181
.. _`Cloudflare` : https://blog.cloudflare.com/announcing-support-for-http-2-server-push-2/
You can’t perform that action at this time.
0 commit comments