Repository navigation
Support for 103 Early Hints? #14226
|
Is this something that can be implemented already, using something like this? {% set headerResponse -%}
HTTP/1.1 103 Early Hints
Link: <{{ mix('css/site.css') }}>; as=style; rel=preload
Link: <{{ mix('js/site.js') }}>; as=script; rel=preload
Link: <{{ entry.heroImage.one().url() }}>; as=image; rel=preload
{%- endset %}
{% header headerResponse %}Or does Yii need to explicitly add support for the 103 response? |
Answered by
brandonkelly
Jan 29, 2024
Replies: 1 comment 1 reply
|
This isn’t currently possible out of the box, because your entire template output is captured by an output buffer until rendering is complete. (Otherwise you would get a PHP error about headers already being sent every time you try putting a That said, it should be possible for us to add some support for this at the infrastructure level within Craft Cloud, and for other hosts. We’ll look into it. |
1 reply
Answer selected by
proimage
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This isn’t currently possible out of the box, because your entire template output is captured by an output buffer until rendering is complete. (Otherwise you would get a PHP error about headers already being sent every time you try putting a
{% header %}tag in your templates.)That said, it should be possible for us to add some support for this at the infrastructure level within Craft Cloud, and for other hosts. We’ll look into it.