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.
-
I think you can find your asnwer [here](http://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay) – MBehtemam May 12 '14 at 08:03
1 Answers
Though your question does not contain detailed information, I'll try to answer,
- Storing in DB is quite expensive if you have large no of images
- 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,
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
if you want to just store the images then again compression will help you on filesystem
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.

- 8,473
- 2
- 27
- 45
-
Hi Nachiket, thanks for your swift response. Can you please suggest best tool or website for lossless compression ? – user20072008 May 12 '14 at 14:13
-
Glad to hear that it was useful :) There are various algorithms but I have used following. you can have a look and try https://kraken.io/web-interface this is good tool which lets to select lossy or lossless compression and achieves good image compression. there is actually a list of tools at http://www.clickonf5.org/15311/image-compression-tools-wordpress-plugins/ and detailed algorithms are at http://david.carybros.com/mirror/NPO20141.pdf – Nachiket Kate May 13 '14 at 05:15