AbanteCart Community

General Topics => General Discussion => Topic started by: Palamedes on March 07, 2012, 02:56:04 PM

Title: All product images in one directory is a bad idea
Post by: Palamedes on March 07, 2012, 02:56:04 PM
A system like this one will most likely inspire folks to add a lot of products.. With lots of products you will most likely get a lot of media in the form of images for each product.

Your system as it stands now creates 4 versions of each image in the form of thumbnails of various sizes.  So right there we have 4x the number of images actually uploaded.

And all of them live in image/thumbnails .. this is a bad idea .. It wont take long before this directory will bloat to ridiculous size..

Modern ext3 file system will allow you to have virtually an infinite number of entries so you are unlikely to run into the natural limit of the filesystem, but the more files you have in there the slower your file access time will be thus possibly adding a noticeable drag on page loads.   And you can't assume ext3 will be the file system.  NFS has a limit of 32k..

I would suggest each category or even each product getting it's own directory.. Currently images appear to be {productid/type}-{imageid}-{size}.extension

Probably not a bad idea to have the product id be a directory.
Title: Re: All product images in one directory is a bad idea
Post by: abantecart on March 07, 2012, 04:06:15 PM
This is a valid future issue. We can build directories/files with the same approach it is done in resource library. Noted.

Thanks
Title: Re: All product images in one directory is a bad idea
Post by: Palamedes on March 07, 2012, 04:14:55 PM
Migration for existing users might be an issue if you wait too long..  But thanks for getting to it  :)
Title: Re: All product images in one directory is a bad idea
Post by: abantecart on March 08, 2012, 07:40:07 AM
We will try to get this change to next version in about 1-2 weeks
Title: Re: All product images in one directory is a bad idea
Post by: Palamedes on March 08, 2012, 05:45:07 PM
Sweet!
Title: Re: All product images in one directory is a bad idea
Post by: Nimitz1061 on June 26, 2012, 08:00:34 PM
Good to hear this.  File systems may tolerate a single folder system much better than a well secured FTP service.  So, the planned change will improve user experience on security sensitive hosts..

David