简体   繁体   中英

Loading images into html5 canvas

I am using nodejs sails for my app. The app is going to use 50-100 images at some points. I was wondering if someone can point pro and cons of using /assests/images/ folder vs outside repository ie AWS S3 for image storing and pulling to draw on the canvas.

I would use /assets/images folder if you know that the images are fixed to 50-100.

  • that is, they will not change
  • 50-100 images is not alot of images

If the images are dynamic and changing all the time, then I would use aws s3. To load 50-100 images from S3 will create a "buffering" effect, but it shouldn't be too intolerable.

Yes, use a CDN if you have the option.

Pros : - Save enormously on website load time / speed. - Better for organization / maintenance.

Cons : - One more paid account; but you may end up having to upgrade your hosting anyway if your images continue to add up with more.

But a large factor is still, what your plans are for the future of this web property, will you be adding more images, will the website and other parts of it grow? What is your current hosting? Will you need to update the images alot? Do you have one developer on this or several? Are these large HQ heavy images? Or this just a one off landing page that will never be touched again?

But I do agree with the other answer, if you'll only have max 100 images; then a CDN is more of luxury. But IMO it's never a fixed amount, and it sounds like you may have several of these HTML5 canvas pages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM