Question

I have a website which displays atleast 90 to 100 images. For better performance, I want to know where to store these images ? is it better to store in mySQL database or in website's images folder.

Était-ce utile?

La solution

Though your question does not contain detailed information, I'll try to answer,

  1. Storing in DB is quite expensive if you have large no of images
  2. Storing in filesystem is a good option and store paths in db (which you already know if you have read suggested link)

But for performance first understand your requirement,

  1. if you want to display 100 images on a single page and all at a time then understand what quality of image is required and enough for user. Instead of using very large size images use lossless and lossy compression algorithms which will give you upto 90% reduction in image size which I think will help you in your case

  2. if you want to just store the images then again compression will help you on filesystem

  3. if you can afford CDN(content delivery network), then you dont have to worry about image performance. CDN providers will take care of that thing

Try using browser plugins like pagespeed,GTMetrics etc. to find out suggestions about your website to improve it further.hope this helps.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top