Data URLs

Sometimes you like to think that you pretty much know everything there is to know about URIs and web browsers. I learned something today that I had absolutely no idea about before. The magic data URL protocol.
It’s defined in RFC2397 as a way to include immediate data in a URL.
For example the following defines an inline GIF image in a base64 encoding:

<IMG SRC="data:image/gif;base64,
iVBORw0KGgoAAAANSUhEUgAAADsAAAAvAQMAAABnrCB9AAAABlBMVEUAAAD///+l2Z/dAAAAvElE
QVQY03XQwQ0CIRAF0E9I5GLEClwrkVasxKU07GRK2CMHAn4GdXdNJCS8hDDzB7SxBFvI3PFsLYWW
r5CpRe47FtfgKwTZVvhiBMVUuGwJPODECSpucMmzDi5w6IgOJ0xEsjgiEGLiGTOxgKs3zTxNRyFs
RyWc5iG8IgKTIgFBIcCsYKERPrPMHoX1FIz6D2WF/Xm+rHi3+DZNG4R9Qhw+OI3w/LAxTsEU7UAY
yAhJZ1/0TxR9dxjeNnkBOFrkvJphu9wAAAAASUVORK5CYII=" ALT="Atlassian Dude">

Which, if your browser supports it, will render thusly:

Atlassian Dude

I only discovered this because Yahoo’s excellent YSlow extension for Firebug suggested replacing small, externally referenced images with data protocol representations.
Pretty neat.

Published

in

Related Content

More in ‘
Featured Article
Announcing social enterprise discounts: Atlassian tools for social impact teams
Featured Article
Great managers meet uncertainty with curiosity and confidence
Featured Article
Introducing Databricks Query Runner: Transforming data into insight
Featured Article
Team ’25 Europe: AI that’s changing the game for teams

More Collections

Meet Rovo everywhere: AI that connects every app, every team, every workflow

Introducing Atlassian Software Collection

Move Faster and Work Smarter with Atlassian’s AI-Powered Teamwork Collection