Re: [whatwg] The src-N proposal

On Saturday, November 09, 2013 12:53 AM, Bruno Racineux wrote:
> On 11/8/13 10:46 AM, "Rafael Rinaldi" <rafael.rinaldi@gmail.com> wrote:
> 
> >It looks complex because it tries to solve something complex. I think
> >therešs no way to avoid verbosity to solve such thing.
> 
> The only way to avoid verbosity on every <img> element would be to
> predefine a relationship between the names/keywords of your images and
> their respective sizes, ONCE in the <head>. The browser can then
> substitute the img suffix to get the right image, without having to
> spell-out the full image name every time.

Well, an alternative would be to move the complexity to the server. I very
much doubt that webmasters are going to create all those variations manually
anyway. And if so, it's enough to store them according a naming convention
the server understands. There are already two proposals how this could work:

  http://tools.ietf.org/html/draft-grigorik-http-client-hints-00
  http://tools.ietf.org/html/draft-snell-http-prefer-18

The browser then just needs to make sure that the right headers are set. We
would to be very careful though to not destroy the cacheability of
responses.

Of course, some form of URL templating would work as well but that probably
would become quite complex.


--
Markus Lanthaler
@markuslanthaler

Received on Saturday, 9 November 2013 10:49:54 UTC