Skip to content
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

Multiple <link rel=preload>s with the same preload key appear to cause multiple requests #10786

Open
domenic opened this issue Nov 21, 2024 · 1 comment

Comments

@domenic
Copy link
Member

domenic commented Nov 21, 2024

What is the issue with the HTML Standard?

Reading the spec in https://html.spec.whatwg.org/#link-type-preload , I am pretty sure that

<link rel=preload as=image href=foo.png>
<link rel=preload as=image href=foo.png>

requires doing two fetches. If I am reading the Fetch spec right, the second one might even consume the preload response from the first one?

This seems like a bug. @noamr, do you agree?

I know there are more general issues around to what extent the "memory cache" is specified. But my understanding was that @noamr's work on <link rel=preload> was intended to start putting us on solid footing there. So maybe tackling just this particular case first is worthwhile.

/cc @nidhijaju

@noamr
Copy link
Contributor

noamr commented Nov 21, 2024

What is the issue with the HTML Standard?

Reading the spec in https://html.spec.whatwg.org/#link-type-preload , I am pretty sure that

<link rel=preload as=image href=foo.png>

<link rel=preload as=image href=foo.png>

requires doing two fetches. If I am reading the Fetch spec right, the second one might even consume the preload response from the first one?

This seems like a bug. @noamr, do you agree?

I know there are more general issues around to what extent the "memory cache" is specified. But my understanding was that @noamr's work on <link rel=preload> was intended to start putting us on solid footing there. So maybe tackling just this particular case first is worthwhile.

/cc @nidhijaju

The second preload consumes the first preload, and the following fetch will consume the second preload.
So this works as intended I think?

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

No branches or pull requests

2 participants