Why use data URI scheme?

后端 未结 5 582
太阳男子
太阳男子 2020-11-30 22:37

Basically the question is in the title.

Many people have had the question stackoverflow of how to create a data URI and problems therein.

My question is

5条回答
  •  -上瘾入骨i
    2020-11-30 22:49

    I agree with BiAiB that the real value of Data URIs is making client-side generated content available as file download without any need for server round-trips.

    A working example of using Data URIs for "offering download of a table as CSV" is described on my blog.

    IMHO, the embedding of image (or other binary resource) data into an HTML file for performance reasons is a red herring. The speed gain due to less HTTP connections is negligible and breaks the nice principle of separation between (textual) markup and binary resources (image files, videos, etc.).

    I think HTTP 1.1 pipelining and some suggested improvements to HTTP are a cleaner and better way to handle HTTP network speed issues.

提交回复
热议问题