3 ms·
I like this idea, for simple icons. Standard Unicode code points for symbols could be used to even allow screen readers to read them! Another alternative for p
by mrb 15y ago
I like this idea, for simple icons. Standard Unicode code points for symbols could be used to even allow screen readers to read them!
Another alternative for pages with simple icons is to use the Data URI scheme:
<img src="data:image/png;base64,iVBORw0KGgANSUhE..."/>
This compresses very well with HTTP content encoding when the same icon is repeated in multiple places in the page:
http://en.wikipedia.org/wiki/Data_URI_scheme http://en.wikipedia.org/wiki/Data_URI_scheme
- lparry 15y agoAnd if your user visits more than one page on your site, you've successfully killed asset caching. More data for your server to send _and_ a slower experience for the user, losses all round
- mrb 15y agoTrue, there is no caching. But that's still a technique worthy to use when they are very small (hundreds of bytes), or when the images should never be cached (eg. low-resolution real time status graphs). In these cases, they reduce the amount of data on the wire (no extra HTTP requests) and reduce page load time.
- deleted 15y ago[deleted]
- nickzoic 15y agoNot if you put the data URIs in a stylesheet shared across all pages: that gets cached nicely.