Send window inner dimensions and screen DPI to the server with every request
This is not a thing at the present time in any browser AFAIK, but wouldn't it be magical if SSR code could know exactly how many pixels it needs to render? We could optimize image sizes, we could try to render fonts server side, we could execute media/viewport queries and know the meanings of %-based layouts all before the page even makes it to the client. We could also compute layout on the server and decide to fetch less data (only above the fold for example) for smaller screens during initial page load. I'm surprised we haven't done this a long time ago. Today we'd have to cookie the browser after the first visit. It's a little janky because it doesn't handle a return visitor with a different size, and doesn't handle first time visitors at all. We could even build an entirely native way to render image mime types (when fetched directly by a window) such that the responding CDN knows how to feed the right thumbnail first, and progressively enhance with the full resolution after the thumbnail image renders. In a similar vein, we could send the box model size (and DPI) of an element requesting an image asset, so the CDN can do something similar in choosing an appropriate size.