Zen Cart Logo
Forums / Setting Up Specials and SaleMaker / how to arrange images directory better?

how to arrange images directory better?

Locked

Views: 2,577

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
26 Dec 2009, 1:23 PM
#1
qrhuang728 avatar

qrhuang728

New Zenner

Join Date:
Dec 2009
Posts:
5
Plugin Contributions:
0

how to arrange images directory better?

I have tree level categories, for example: Wholesale Gucci - Gucci Man Shoes - Gucci sneaker. And I plan to create image directory like this :images/Wholesale Gucci/Gucci Man Shoes/Gucci sneaker, then place the product images in the proper cateory directory.
I wonder whether this will effect performance ? And image path in the web page is in 'bmz_cache', does this will lower the possibility of being cataloged by google image? How can I avoid it ?

27 Dec 2009, 9:58 AM
#2
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: how to arrange images directory better?

If you create subdirectories within your images directory, this should infact improve your performance. The reason for this is that the Zen code checks to see if product images exist, which involves the PHP code iterating through image file within a directory. If there are 2000 images in the directory, this will take longer than if it goes to a specific category directory and then looks through 20 images.

As for the Google images probloem, you may want to adjust the code in includes/functions/general.php so that the image handler code is only employed when the current user is NOT a spider. Whether or not the user is a spider is already stored in a session variable, and if it is true, then you could simply return the actual image, rather than the cached version. Obviously the new Google search results take site speed into consideration, so it's a choice between site speed results, and getting your original image in the search results.

Absolute

28 Dec 2009, 6:28 AM
#3
qrhuang728 avatar

qrhuang728

New Zenner

Join Date:
Dec 2009
Posts:
5
Plugin Contributions:
0

Re: how to arrange images directory better?

Absolute:

If you create subdirectories within your images directory, this should infact improve your performance. The reason for this is that the Zen code checks to see if product images exist, which involves the PHP code iterating through image file within a directory. If there are 2000 images in the directory, this will take longer than if it goes to a specific category directory and then looks through 20 images.

As for the Google images probloem, you may want to adjust the code in includes/functions/general.php so that the image handler code is only employed when the current user is NOT a spider. Whether or not the user is a spider is already stored in a session variable, and if it is true, then you could simply return the actual image, rather than the cached version. Obviously the new Google search results take site speed into consideration, so it's a choice between site speed results, and getting your original image in the search results.

Absolute
Thanks Absolute for reply.
By the way,there are still two questions:
1.Can I create image directory 'Wholesale Gucci' with a blank in it in linux? Or should I replace blank with '-'?
2.The image path is too long. For example, one product's image path is '/Wholesale Gucci/Gucci Man Shoes/Gucci sneaker/Anna-Wallet-1004.jpg',the path size is 58,while the products_image is varchar(64).Can I change the definition to varchar(100) without other modification?

31 Dec 2009, 8:23 AM
#4
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: how to arrange images directory better?

Always avoid spaces in URLs. Every system is different, for example Google etc, and as you don't know how they react to spaces, you want to give them a character they expect, such as an underscore '_' or a dash.

As for the varchar(64), if you know you are going to be giving image pages long URLs, I would change this to 254. Thats the highest value possible for a varchar field.

Obviously you have said that you use Image handler, so these huge URLs should never actually make it to a users browser, as they will be replaced with the bmz URL, but with the tweak mentioned earlier, these would then be sent to the Search Engines for indexing.

Absolute