-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Idea: negotiate with HTTP Client Hints #2
Comments
This is a great suggestion, thank you! I'll have to have a think about the API I want to implement for each of these, since unfortunately we can't easily get information about files from Pages yet, such as their |
First thought is: since this is a plugin one will use with premeditation, then maybe a way to go would be just to allow the creator to provide data-saver alternatives for assets (distinguished by name with some pure function)? Then the plugin would have to do the following algorithm
It's then entirely up to the author (at a cost of generating more during build and eating up the "number of elements in deployment" limit) It could be implemented like this:
It adds |
Something like that should work great, yes! There's unfortunately also not a way to efficiently check if an asset exists yet either (though I'm regularly encouraging the team to add one), so I'd have to always try and fetch it in its entirety (if enabled), which could add latency, especially if done in combination with I'm very much in favour of supporting any Client Hints in this plugin that make sense though! |
I think that it may be a good next step to add negotiation not only for the type (i.e. using
Accept
) as the current implementation does, but also using more recent approach: Client hintsThis way the following can be addressed:
Save-Data
(which is even a low-entropy one so it's sent right awayECT
Sec-CH-DPR
) and size descriptors (withSec-CH-Viewport-Width
andSec-CH-Viewport-Height
The text was updated successfully, but these errors were encountered: