3 ms·
I think this should be done by using content negotiation. The browser should include a header with the desired resolution (in DPI, not screen pixel width). The
by ars 15y ago
I think this should be done by using content negotiation. The browser should include a header with the desired resolution (in DPI, not screen pixel width).
The server should then redirect to a new image url (to maintain caching). Something like images/foo.png;dpi=100
Or, perhaps better:
<img src="images/foo.png" dpi="100 70 200">
A browser with support for the dpi attribute would pick the best one from the list, then send a request for an image:
images/foo.png?dpi=100
Older browsers would use the regular image. This would avoid the redirect and the need for special programming on the server (which is hard with ordinary hosting).
One thing that would still need to be worked out is the scaling factor for pixel sizes written in the css for the image.