Skip to content

Process Preload link headers #7622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 8, 2022
Merged

Process Preload link headers #7622

merged 12 commits into from
Mar 8, 2022

Conversation

noamr
Copy link
Collaborator

@noamr noamr commented Feb 15, 2022

Preload links based on link headers, some of them on document creation,
and the rest (viewport-dependant ones) when response chunks start arriving.

This can be used as an infra for early-hints and other link types.

Conforms to the current common denominator of implementations.

See #4224
Closes w3c/preload#148


/browsing-the-web.html ( diff )
/infrastructure.html ( diff )
/semantics.html ( diff )

@whatwg whatwg deleted a comment from feeroz73182 Feb 16, 2022
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, yet again you tackle some major tech debt and give us hope for the future :). /cc @annevk as some of the header parsing stuff is making me feel out of my depth.

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very glad you found that RFC parser!

@bashi
Copy link

bashi commented Feb 22, 2022

I'm excited to see this to be defined!

One question from the POV of Early Hints: I guess we may not be able to create a document when we process link headers in Early Hints since we wouldn't know the content type of the final response. How should we handle the case?

Here are options I came up with: (1) Delay processing link headers until we can create a document, (2) define the process link headers algorithm without the document parameter, replacing the parameter with some other parameters which can be obtained from both early hints responses and the final response, or navigationParams.

I think (1) wouldn't be a viable option since it effectively makes Early Hints preloads no sense. OTHO I'm not sure (2) can be realistic. There might be other options.

cc: @yutakahirano @yoavweiss

@noamr
Copy link
Collaborator Author

noamr commented Feb 22, 2022

I'm excited to see this to be defined!

One question from the POV of Early Hints: I guess we may not be able to create a document when we process link headers in Early Hints since we wouldn't know the content type of the final response. How should we handle the case?

Here are options I came up with: (1) Delay processing link headers until we can create a document, (2) define the process link headers algorithm without the document parameter, replacing the parameter with some other parameters which can be obtained from both early hints responses and the final response, or navigationParams.

I think (1) wouldn't be a viable option since it effectively makes Early Hints preloads no sense. OTHO I'm not sure (2) can be realistic. There might be other options.

cc: @yutakahirano @yoavweiss
Thanks for the suggestions!

I started prototyping something along the lines of (2), the idea is that navigation params would hold a map of preloaded resources that the document will use as the initial map once it's created.

As you said, (1) is not an option because it beats the purpose of early hints being early...

@bashi
Copy link

bashi commented Feb 22, 2022

Fantastic, thank you for the update!

noamr and others added 10 commits February 28, 2022 09:31
Preload links based on link headers, some of them on document creation,
and the rest (viewport-dependant ones) when response chunks start arriving.

This can be used as an infra for early-hints and other link types.

Conforms to the current common denominator of implementations.

See whatwg#4224
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Link header processing
5 participants