I'm a web developer at http://www.ssofb.co.uk in Aberdeen, Scotland.
Got a random blog at http://www.andygaskell.blogspot.com/.
I'd noticed slow loading times on my host's server, but ok loading times on my local dev server. The shop is about to go live so I thought I'd better have a look into. The shop has 18,000 products in ~300 categories, and the home page was taking sometimes 10 seconds to load, with only 10% of this being download time. The HTML sent to the user was 73KB, so a fair size, but not huge. Anyway, I've got the search module enabled, and that was generating quite a lot of HTML, as the "Search in a category:" select in the search module was creating and <option> for each category. Anyway, just as a test, I removed the category code from catalog/view/theme/mytemplate/template/module/search.tpl and catalog/controller/module/search.php, and the load times went down to 2-3 seconds, which is much better. HTML code is now 43KB, so that's better too.
This is OC 1.4.0, if I mention the name of the host, I think I'll get flamed, so I'll keep quiet on that one
I'm a web developer at http://www.ssofb.co.uk in Aberdeen, Scotland.
Got a random blog at http://www.andygaskell.blogspot.com/.
That is a great idea as I have many cats also. Would you mind to PM me with the revised search.php file?AndyGaskell wrote:I've just noticed something with the big shop I'm working on just now, which I thought might be useful generally, so good to share.
I'd noticed slow loading times on my host's server, but ok loading times on my local dev server. The shop is about to go live so I thought I'd better have a look into. The shop has 18,000 products in ~300 categories, and the home page was taking sometimes 10 seconds to load, with only 10% of this being download time. The HTML sent to the user was 73KB, so a fair size, but not huge. Anyway, I've got the search module enabled, and that was generating quite a lot of HTML, as the "Search in a category:" select in the search module was creating and <option> for each category. Anyway, just as a test, I removed the category code from catalog/view/theme/mytemplate/template/module/search.tpl and catalog/controller/module/search.php, and the load times went down to 2-3 seconds, which is much better. HTML code is now 43KB, so that's better too.
This is OC 1.4.0, if I mention the name of the host, I think I'll get flamed, so I'll keep quiet on that one
DownloadXS.com : Stock Photos & Vintage Illustrations, Fresh PLR Articles and more.
http://www.DownloadXS.com
Only if it's GoDaddy.AndyGaskell wrote:This is OC 1.4.0, if I mention the name of the host, I think I'll get flamed, so I'll keep quiet on that one
Boy are you right on the search categories. I just did a check on the live server with 350 categories and the front page load time was 11 seconds. Ouch!
It's definitely the search categories that are the issue. Remove the code and the long load time completely disappears. Maybe they aren't being loaded from the cache? I'll have to do some checking.
In /catalog/view/theme/[theme name]/template/common/header.tpl delete:caspara wrote:That is a great idea as I have many cats also. Would you mind to PM me with the revised search.php file?
Code: Select all
<select id="filter_category_id">
<option value="0"><?php echo $text_category; ?></option>
<?php foreach ($categories as $category) { ?>
<?php if ($category['category_id'] == $category_id) { ?>
<option value="<?php echo $category['category_id']; ?>" selected="selected"><?php echo $category['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $category['category_id']; ?>"><?php echo $category['name']; ?></option>
<?php } ?>
<?php } ?>
</select>
-Ryan
/catalog/controller/common/header.php
Find
Code: Select all
$this->data['categories'] = $this->getCategories(0);
Code: Select all
if (!$this->cache->get('search.categories.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id'))) {
$this->data['categories'] = $this->getCategories(0);
$this->cache->set('search.categories.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id'), $this->data['categories']);
} else {
$this->data['categories'] = $this->cache->get('search.categories.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id'));
}
-Ryan
/catalog/controller/common/header.php
/catalog/controller/product/search.php
Replace
Code: Select all
$this->data['categories'] = $this->getCategories(0);
Code: Select all
if ($this->cache->get('search.categories.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id'))) {
$this->data['categories'] = $this->cache->get('search.categories.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id'));
} else {
$this->data['categories'] = $this->getCategories(0);
$this->cache->set('search.categories.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id'), $this->data['categories']);
}
public function addCategory
public function editCategory
public function deleteCategory
Replace:
Code: Select all
$this->cache->delete('category');
Code: Select all
$this->cache->delete('category');
$this->cache->delete('search.categories');
-Ryan
Before:
http://www.webpagetest.org/result/10032 ... 1/details/
After the above modification (and caching, GZipping js and css):
http://www.webpagetest.org/result/10033 ... 1/details/
I know it still isn't a great site speed, but I'm going to continue to improve it. Thanks again for your help.
DownloadXS.com : Stock Photos & Vintage Illustrations, Fresh PLR Articles and more.
http://www.DownloadXS.com
datacon @ 100k
ibdesign @ 56k
caspara @ 40k
alleikis @ 27k
AndyGaskell @ 20k
tintedpixel @ 12k
airetechit @ 9k
...and the winner is, OpenCart, for scaling really nicely
I'm a web developer at http://www.ssofb.co.uk in Aberdeen, Scotland.
Got a random blog at http://www.andygaskell.blogspot.com/.
I have quite a lot of categories and when I have the enabled the site is very slow and when I disable the categories the site is lightning fast - so the issue is with the load of the categories.
Does anybody know if the cache functionality is included in 1.5 or not?
im using opencart 1.5.05
i have 10.000 product in the database.
opencart is slow working why?
http://www.pintiyiz.com main root
http://www.pintiyiz.com/Bilgisayar a categorie opens in 11 seconds bad performance
products are added automatically with c #
please help me .
Your's opened in about 6 seconds for me, which is around about the same time as mine :-)sguven wrote:hi
im using opencart 1.5.05
i have 10.000 product in the database.
opencart is slow working why?
http://www.pintiyiz.com main root
http://www.pintiyiz.com/Bilgisayar a categorie opens in 11 seconds bad performance
products are added automatically with c #
please help me .
Has anybody found out if the solution above with cache of categories will speed up load?
Users browsing this forum: namweb4s and 174 guests