I built a script that replaced all inline images with data URI's to reduce http requests and seed up loading time on mobile devices.
Unfortunately I experienced slower loading. I figure it depends on that the html file was bigger (around 100kb instead of around 5 kb) :)? Or is there something else with data URIs that slows down the page load?
Must the browser complete download of the full document before it can load liked sources in it? Or will linked sources, for example css and javascript in the top of document, be loaded before browser has completet the full document?
How does it work with CSS? Must the browser load the complete CSS file before reading all the CSS settings?
If so, is it better to have a sepearate CSS file for data uri like this:
- Load CSS for structure (no data uri's)
- Load CSS for background images (all background images in URI format)
Will a "separate chaced jpg file" load faster than a "URI based image included in a cached css file"?
Any other suggestions on how to use data URIs?