5

I have big problem to solve before we start our website: SPEED OF MAGENTO

Main problem is TTFB(Time To First Byte), and I find connection between problem and product images in Magento.

For example this is loading speed with and without images in product category:

With: https://i.stack.imgur.com/3f3Pn.jpg

Without: https://i.stack.imgur.com/UNnHf.jpg

My current image code is this:

<img class="main-image" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(219,219) ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>

How to change it and try to resolve my problem?

Mukesh
  • 7,630
  • 21
  • 105
  • 159
Nasku
  • 101
  • 1
  • 11
  • The images are cached, so it takes long only on first page load. Is this still a problem? – Marek Mar 03 '15 at 15:37
  • Magento is resizing the images and move them into an cache folder. In default setup, this path should be rootdir/media/catalog/product/cache. For first pageload it takes some time, until the images are created. – manu Mar 03 '15 at 15:38
  • There is no question about first page load, and for each. Every time on product or category page load time is like this. I search for a way to load product image in different way. – Nasku Mar 03 '15 at 15:59
  • Where are your images served from ? (path of the image) if the image is not served from a path like `media/catalog/product/cache/1/small_image/219X/...` that may means that you have permission error, and that magento tries to write the image for cache each times you try to access the page. So be sure you have the right permission on `media` folder you should have done something like `sudo chmod -R o+w media` – β.εηοιτ.βε Mar 03 '15 at 17:32
  • I managed to get image url to show with this code: `getMediaUrl( $_product->getSmallImage()) ?>` But i can't find out how to crop effectivly images not to load full file? Any ideas? – Nasku Mar 04 '15 at 09:37
  • Is your media folder writeable? It could be that Magento is resizing the images, but is not able to write to the `media/catalog/product/cache` folder. – Giel Berkers Aug 16 '16 at 12:07

1 Answers1

0

It may happen because of not using cache feature of magento. Make sure cache feature is enabled. If you are loading images by your custom extension, do not call image directly from the media directory.