I discovered that you can covert images into base64 strings and use those string within
img tags and css like this:
<img alt="" src="data:image/png;base64,iVBORw0KGgoAhEUgAAA ... FTkSuQmCC" />
background-image: url(data:image/png;base64,iVBORw0KGgoAAAA ... uQmCC);
Serving images in this way seems improve website load times, but may have some drawbacks. I have a few questions about this method:
- Will the browser cache these images?
- Is it faster for a page to render this string or an image file?
I am interested in other advantages or disadvantages involving this image serving method.