Mobify warns against data URI use on mobile

Mobify chief architect and co-founder Peter McLachlan has presented some new research into the use of data URIs and how they impact speed on mobile devices.

In his article, McLachlan explained that a “key rule to high performance web design is to make fewer HTTP requests,” especially on smartphones, “where high latencies are the norm”.

Data URIs (where images are embedded directly in the document rather than being called separately) have been considered best practice for reducing said requests — at least under certain circumstances.

According to McLachlan’s latest research, on measuring the performance of “hundreds of thousands of mobile page views”, loading images “using a data URI is on average [six times] slower than using a binary source link such as an img tag with [a] src attribute”.

The conditions behind the Mobify experiment were outlined in full within the article, including the use of a 17.8k PNG, which commenter Larry Garfield suggested wasn’t something he’d usually do "under normal circumstances".

However, McLachlan noted in his conclusion that the experiments he performed weren’t designed to negate the use of data URIs. Instead, the article appeared to show clearly how data URIs should be used infrequently for small images, along the lines of long-standing best-practice advice.

He also added that, if you’re thinking of using data URIs, it’s worth considering CSS sprites instead, which will be “more performant in most cases”.

Thank you for reading 5 articles this month* Join now for unlimited access

Enjoy your first month for just £1 / $1 / €1

*Read 5 free articles per month without a subscription

Join now for unlimited access

Try first month for just £1 / $1 / €1

The Creative Bloq team is made up of a group of design fans, and has changed and evolved since Creative Bloq began back in 2012. The current website team consists of six full-time members of staff: Editor Kerrie Hughes, Deputy Editor Rosie Hilder, Deals Editor Beren Neale, Senior News Editor Daniel Piper, Digital Arts and Design Editor Ian Dean, and Staff Writer Amelia Bamsey, as well as a roster of freelancers from around the world. The 3D World and ImagineFX magazine teams also pitch in, ensuring that content from 3D World and ImagineFX is represented on Creative Bloq.