Forum Moderators: open

Message Too Old, No Replies

Will IE7 support data URI scheme?

If not, how to persuade Microsoft to add it?

         

lammert

4:49 pm on Sep 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



For those who don't know what I am talking about a short explanation.

A URI is a uniform resource identifier, also often called URL in normal day language. It is used to define a resource. Some common forms we see in daily life are:

http://www.example.com/file.html
ftp://ftp.example.com/file.dat
mailto:user@example.com

Most of these URIs are recognized by modern browsers. One however, the data: URI defined in RFC 2397 is recognized by browsers like Firefox, Opera and Safari, but not by Internet Explorer. Most URIs used in HTML pages are used to point to resources outside of the current page. The data: URI can be used to embed a (small) amount of binary data inside a HTML file.

On many of my pages I currently use a few small images. These are optimized images in PNG format with a size between 84 and 88 bytes. That is almost nothing, but when you look at the size of the TCP/IP packets to setup the connection, retrieve the images and the size of the HTTP protocol headers added to it, these handful of bytes cause a significant amount of traffic overhead and latency for the visitor. Especially if the visitor is located in a different country than where the website is hosted the delay it takes to load the images is visible.

CSS and JavaScript can be embedded in HTML files within <script> and <style> containers. data: URIs allow binary data like images to be embedded in almost the same way. Unfortunately all common browsers recognize the data: URI, except Internet Explorer.

I hoped that IE7 would finally add this functionality, but until now the data: URI is not recognized in the beta version, and I have seen no sign that they will add it to the finished product.

What can we do to persuade Microsoft to add this to their new browser?

For those who still don't understand what this is all about, here is an example how an image could be embedded directly in HTML.

<img src="data:image/png;base64,BASE64ENCODINGOFIMAGE" alt="embedded image">

encyclo

7:01 pm on Sep 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Microsoft has announced that the current beta version of IE7 is "feature-complete", so I unfortunately think it would be highly unlikely that they would add data URI support before the final release. It's a shame, as data URIs are supported in alternative browsers and, as you mention, are perfect for small elements embedded within a page.

I assume that with your current setup you are preloading images where possible and ensuring that they are cached by the browser?

lammert

7:58 pm on Sep 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



"Feature complete". This will certainly include the many IE specific HTML extensions which will try to let webdesigners make sites that are not standard compliant. I regret they didn't put more effort in complying to some standards like the data:URI which exists already 8 years now and was already there before IE5 was even launched.

About my current implementation: yes, I have cache times of several weeks on these images, so repeat visitors have no problems. But the sites where they on appear have a typical user which only visits once via the search engines. There are only a few repeat visitors. I have estimated that embedding these images in the HTML could reduce the number of requests per day to the server with 25 to 30%.

Robin_reala

8:08 pm on Sep 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To be fair to MS, they haven't actually added any new 'non-standard' features this release. Data URIs won't be supported, but they're a part of Acid2 so I expect we'll see them for IE8.

DrDoc

10:26 pm on Sep 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



or IE7 SP1

encyclo

1:40 am on Sep 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Lammert, as you are currently loading several small images, have you considered using the "CSS Sprites" approach of using one image file (ie. one GET request) containing each graphic element and displaying parts of the "sprite" selectively? It may be an approach which could help reduce the number of requests to the server.

lammert

7:27 am on Sep 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Encyclo, an excellent idea!

I thought sprites were something from the Atari and Amiga era, but the concept is probably also adaptable in my situation. It will reduce the number of image requests to one, with the added advantage that repeat visitors already have the image cached.

DrDoc

10:13 pm on Sep 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Great idea, encyclo!