Data URLs
Data URLs are a URI scheme that allows embedding small data directly into web documents, such as HTML, CSS, or JavaScript, as base64-encoded strings. They enable resources like images, fonts, or scripts to be included inline without requiring separate HTTP requests, which can improve performance for small assets. This scheme is defined by RFC 2397 and is supported by all modern web browsers.
Developers should use Data URLs when embedding small, static resources (e.g., icons, small images, or inline scripts) to reduce HTTP requests and improve page load times, especially in performance-critical applications like single-page apps or mobile sites. They are also useful for generating dynamic content on the fly, such as creating images from canvas elements or embedding data in email templates where external resources might be blocked.