Originally Posted by
Diavire
Hi Linda,
Thanks for the response.
Maybe we mean different things, I know of the functionality, but that wouldn't speed up zen-cart's search for additional images that it does, in the same folder as where the main image is (usually just /images/).
Well, unless you make a lot of separate folders, but that wouldn't be handy if you put up a lot of products.
I'll describe the functionality I mean:
Our site used to have around 6000 - 8000 products, so that was at least as many images (+ additional images), all in the /images/ folder.
Page loadtimes were around 2.5 - 3 seconds, it felt okay, but one day I was testing and hadn't copied the image folder, and noticed that load speed was much faster.
Eventually I understood that it was because Zen-Cart was looking through all those image filenames to find additional images to display, when it had an empty folder to work with, it was done in no time.
I made a new folder structure in /images/, starting with /images/extra_images/.
In that folder are folders starting with the 'thousand' count of the product id, so a product id of 500 will be in folder 0, product id 4599 will be in folder 4, etc.
In those folders are subfolders with product id's, where the actual extra images go.
Code changes make zen-cart look in extra_images to see if the thousandcount folder exists, if it doesn't it creates it, then it looks if a folder with the full product_id exists in that subfolder, if it doesn't, it creates it.
If the product id folder did not exist, it will look in the main images folder for additional images, if it finds any it will move them to the product id folder.
if the folder did exist, it will only look in that folder for additional images.
That way, only the very first access of a product page is 'slow', all subsequent visits to that product page will only look for additional images in the product id's 'private' folder, where it wil either find no images, or just the images intended for that product.
We went from the mentioned 2.5 - 3 second pageloads to sub-second pageloads, usually 0.3 - 0.7 seconds. We're now at about 17000-18000 products and the loadtime hasn't changed, I wouldn't want to think about what the loadtimes would be like otherwise..
The main images stay in the normal /images/ folder in this setup btw, as they're not searched for, but directly accessed.
I hope I've written this down in an understandable manner, I've tried to be as clear as I can be, but if not, do let me know. :)
Is such functionality already available in new versions of Zen-Cart, or via plugin? If not, do you think a coderelease would benefit other Zen-Cart users?
Edit: Just thought that maybe the speed increase was just because of a slow drivespeed at our hoster (though in most things they seemed speedy enough), and people on expensive hardware don't really have this problem to start with, but I suppose there are plenty of people running on slower hardware, or shared hosting.
Kind regards,
Wouter
Bookmarks