Bypassing mime types using data URI


Developer.Mozilla.org

data URIs, defined by RFC 2397, allow content creators to embed small files inline in documents.

MSDN.microsoft.com

Specifies a data URI, which is a resource, typically an image, embedded in the URI as opposed to one loaded from an external URL.

Why The data: URI Scheme Could Help Save Your Slow Site

This is why reducing the number of HTTP requests a browser needs to make to finish loading a page is a fundamental step in optimizing web sites for speed. One (perhaps underutilized) way to do this is by embedding binary data such as images for oft-used icons inline with other assets using the data: URI scheme.

There are many uses for data uri — I’ve had the need to send html pages by email (sorry don’t know of anybody who has already made an interface to take a complete page content from a URL address and make it into a single file). However with new file formats coming out and many web hosts who have not updated their mimi types — people are having difficulties in implementing some file formats on their web site. Normally not a difficult configuration and should be able to be accomplished by one line in the .htaccess file. However sometimes it may be difficult to reconfig the server.

Resources — converting to base64 can be done with ease online … http://www.opinionatedgeek.com/dotnet/tools/base64encode/

Advertisements

One response

  1. […] canvas images on facebook the images need to be converted to base64 – Base 64 encoder and use a data uri for the image – because the Canvas requires the image come from the same domain as the html5 […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: