Data URI Scheme - Advantages

Advantages

  • HTTP request and header traffic is not required for embedded data, so data URIs consume less bandwidth whenever the overhead of encoding the inline content as a data URI is smaller than the HTTP overhead. For example, the required base64 encoding for an image 600 bytes long would be 800 bytes, so if an HTTP request required more than 200 bytes of overhead, the data URI would be more efficient.
  • For transferring many small files (less than a few kilobytes each), this can be faster. TCP transfers tend to start slowly. If each file requires a new TCP connection, the transfer speed is limited by the round-trip time rather than the available bandwidth. Using HTTP keep-alive improves the situation, but may not entirely alleviate the bottleneck.
  • When browsing a secure HTTPS web site, web browsers commonly require that all elements of a web page be downloaded over secure connections, or the user will be notified of reduced security due to a mixture of secure and insecure elements. On badly configured servers, HTTPS requests have significant overhead over common HTTP requests, so embedding data in data URIs may improve speed in this case.
  • Web browsers are usually configured to make only a certain number of (often two) concurrent HTTP connections to a domain, so inline data frees up a download connection for other content.
  • Environments with limited or restricted access to external resources may embed content when it is disallowed or impractical to reference it externally. For example, an advanced HTML editing field could accept a pasted or inserted image and convert it to a data URI to hide the complexity of external resources from the user. Alternatively, a browser can convert (encode) image based data from the clipboard to a data URI and paste it in a HTML editing field. Mozilla Firefox 4 supports this functionality.
  • It is possible to manage a multimedia page as a single file.
  • Email message templates can contain images (for backgrounds or signatures) without the image appearing to be an "attachment".

Read more about this topic:  Data URI Scheme

Famous quotes containing the word advantages:

    To say that a man is your Friend, means commonly no more than this, that he is not your enemy. Most contemplate only what would be the accidental and trifling advantages of Friendship, as that the Friend can assist in time of need by his substance, or his influence, or his counsel.... Even the utmost goodwill and harmony and practical kindness are not sufficient for Friendship, for Friends do not live in harmony merely, as some say, but in melody.
    Henry David Thoreau (1817–1862)

    If we live in the Nineteenth Century, why should we not enjoy the advantages which the Nineteenth Century offers? Why should our life be in any respect provincial?
    Henry David Thoreau (1817–1862)

    The advantages found in history seem to be of three kinds, as it amuses the fancy, as it improves the understanding, and as it strengthens virtue.
    David Hume (1711–1776)