What are the risks of using data: image / jpeg; base64?

I use the TinyMCE text editor in a custom CMS, and I drag the images into the text box and then align them. They are assigned data: image / jpeg; base64 value and they are displayed in the user area. But what are the risks with this? Are these images displayed in all browsers? I think there are some SEO problems that need to be considered, but it seems that this would be the best system in which they would be stored in the database, and not in folders.

What do you think?

+6
source share
2 answers
  • IE7 and earlier do not support URL data: at all.

  • IE8 does not support URL data: longer than 32 KB. (Do you feel the trend here?)

  • Base64 encoded images are about 30% larger than if they were saved.

  • If you reuse images in multiple documents, you get multiple copies. If you saved them as files, you can link to the same file in every place.

+11
source

I think this is the worst idea. The size of the images is different, and some are smaller, some are quite large. The larger the image, the more difficult it will be to display its browser. The longer the HTML will be more difficult for the browser, the rendering will be. The browser can freeze for a very large amount of time, and it is annoying.

It is best to save images as files.

+1
source

Source: https://habr.com/ru/post/915752/


All Articles