A
data URL is a type of
URI where the type of data, and the data itself, is included in the URL. When accessing a data URL, no request to a server is made since all content is embedded in the URL. Data URLs are generally used as a replacement for small files, as they become unwieldy when used with large content.
data:MIME-type;base64,content
For example:
Document doc = "Data URLs added to CSPro 8.0.";
doc.getValueJson(serializationOptions := "{ \"binaryDataFormat\": \"dataUrl\" }") // returns the binary data as:
Clicking on that link, or copying and pasting that link into a web browser's address bar, will show the text "Data URLs added to CSPro 8.0."
Generally when using CSPro to create URLs with content, you will want to use
localhost URLs, which are faster to create and more efficient. A localhost URL is temporary, only valid while the CSPro application is running, so a data URL may be a good choice if you need a URL that can permanently refer to the data. Data URLs are approximately 33% larger than the content itself, so using data URLs for large files is not advised.