Servers can only intelligently set a response’s resolution, if they are adapting to fit a Width hint, if they also have a DPR hint. For instance, let's say an author wrote the following markup on a page configured to send just the Width hint:
<img src="a.jpg" sizes="33vw" />
On a 2x device/1000px-wide viewport, this might generate a request like:
GET a.jpg
Sec-CH-Width: 660
This doesn't give the server enough information to set a resolution on the response. The least-worst thing a server can do here, I think, is send a 660-pixel-wide, 1x resource, which will have a density-corrected intrinsic width of 660px, instead of 330px.
If there's an extrinsic size on the image, this isn't a problem, but if there isn't, the image will be too big, and blurry.
Two options spring to mind:
Revert Width to be defined in terms of CSS px (or, more likely, deprecate it and mint something new). This way Width-only images will have the correct layout width, even if they're the wrong resolution. This makes more sense to me as an author – I did supply the server with the Width; I didn't supply the server with the DPR. It makes sense that adding DPR fixes the DPR problem.
Having some sort of authoring requirement to enable DPR whenever Width is enabled. And maybe a console warning or something.
Servers can only intelligently set a response’s resolution, if they are adapting to fit a
Width
hint, if they also have aDPR
hint. For instance, let's say an author wrote the following markup on a page configured to send just theWidth
hint:On a 2x device/1000px-wide viewport, this might generate a request like:
This doesn't give the server enough information to set a resolution on the response. The least-worst thing a server can do here, I think, is send a 660-pixel-wide, 1x resource, which will have a density-corrected intrinsic width of 660px, instead of 330px.
If there's an extrinsic size on the image, this isn't a problem, but if there isn't, the image will be too big, and blurry.
Two options spring to mind:
Width
to be defined in terms of CSSpx
(or, more likely, deprecate it and mint something new). This wayWidth
-only images will have the correct layout width, even if they're the wrong resolution. This makes more sense to me as an author – I did supply the server with theWidth
; I didn't supply the server with theDPR
. It makes sense that addingDPR
fixes the DPR problem.DPR
wheneverWidth
is enabled. And maybe a console warning or something.