4 ms·
Better than this specification hassle is this solution: The browser should send the density of the screen in ppi (calculated by the screen resolution and the s
by tferris 14y ago
Better than this specification hassle is this solution:
The browser should send the density of the screen in ppi (calculated by the screen resolution and the screen information provided by the OS) together with all the other standard stuff like OS, screen resolution, etc.
With this information the server can decide which images to send.
- ars 14y agoNo, this won't work in the wild. It breaks caching completely. It requires scripting just to serve an image. The same url can have different data - imagine if you resume downloading a file, only to suddenly have a different file.
- alexchamberlain 14y agoI disagree. Caches would have to be intelligent. Remember they already have to pay attention to language headers etc. URLs represent a conceptual resource, rather than a single file.
- ars 14y agoCaches (proxies) already exist. You don't have the option of reprogramming them for this new header.
- michaelmior 14y agoPart of the problem here is that there are a wide range of pixel densities. The server could choose to display the same image for some range of values but trying to get a caching proxy to sort this out is highly nontrivial.
- othermaciej 14y agoScreen PPI (in physical pixels per physical inch) is not the relevant consideration - device pixels per CSS pixel being something other than 1 is the case you care about. And the browser needs to know the intended resolution of the image so it can tell whether to downscale it.
- kennu 14y agoWeb servers shouldn't need to rely on any other information than the URL in order to serve the right content. This keeps the simple use cases simple, as the URL directly translates to a file on the server. Otherwise every web werver in the world would need some special new logic for choosing different files.