在前端使用Node.js和Vue.js从Amazon S3私有存储桶中显示图像。

huangapple go评论68阅读模式
英文:

Show images from Amazon S3 private bucket in frontend using Node js Vue js

问题

我尝试从Amazon S3图像获取缓冲区,然后将其转换为Base64字符串并发送到前端。它运行良好,可以在页面上显示图像,但问题在于Base64处理时间太长。如何制定一个比Base64快得多的解决方法?

英文:

i tried getting the Buffer from Amazon S3 image then i converted into base64 string and sent to the frontend.
It worked well, it shows the image in the page, but the problem is the long time of proccesing base64.
How to make a workaround which will be much faster than base64?

答案1

得分: 0

你可以为每个图像生成S3签名URL链接,然后将这些链接发送到前端。现在,前端可以分别调用以获取所有图像。

这将减少后端处理所需的时间。

英文:

You can generate s3 signed URL link for each image and send the links to the front end. Now, the front end can make respective calls to fetch all images.

This will reduce the time that backend does for the processing.

huangapple
  • 本文由 发表于 2023年1月5日 05:02:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/75011283.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定