_64 images

Base64 encoding images inline HTML for speed

There is an idea floating around that encoding images base64 and loading them inline in your HTML might be quicker than loading each image in turn via a separate asset call. This does sound good as you lose the overhead of all the connections for each download. However, your raw HTML does grow quite large and it has been reported base64 encoding increases the size of your images (however not overall in this case, see below). Still, it's worth an experiment to get some real numbers in a real world example.

So I have built 3 versions of a page that has 29 good sized jpg images on it. The first one is standard, with all the embedded links, the second version has half the images encoded inline and the 3rd version has all images inline:


It turns out it doesn't make much difference. What we gain on connections we lose on the large HTML file download time. I'll let the test run for a few days and update the trend graphs later, but initial results suggest there is no gain to be made here. (See the download size details below as well):

All raw image calls


Half raw image calls, half embedded base64 encoded


All embedded base64 encoded


Trend graphs over several test runs over the course of a day


Page download size and number of request details

Webpagetest reports these 3 pages are very similar in size, if anything as I encode more images, my overall download size is decreasing. Some of this could be due to gzip of HTML versus jpg compression. But at least in this case, the different options used don't make much difference:

Half raw image calls, half embedded base64 encoded


Half raw image calls, half embedded base64 encoded


All embedded base64 encoded


[Home] [About (CV)] [Contact Us] [JMeter Cloud] [webPageTest] [_64 images] [asset moniitor] [Linux Monitor] [Splunk ETL] [Splunk API] [AWS bash] [LR Rules OK] [LR Slave] [LR CI Graphs] [LoadRunner CI] [LR CI Variables] [LR Bamboo] [LR Methods] [LR CI BASH] [Bash methods] [Jenkins V2] [Streaming vid] [How fast] [Finding Issues] [Reporting] [Hand over] [VB Scripts] [JMeter tips] [JMeter RAW] [Dynatrace] [Documents] [FAQ] [Legal]

In the Cartesian Elements Ltd group of companies