Help in speeding up the site (3.7)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Lots of good stuff here https://www.nopcommerce.com/common-tips-settings-recommendations-to-optimize-performance-in-nopcommerce.

Be careful when using the cloud and make sure the sql server and the NOP Commerce app are in the same location.  We originally set ours up in Azure and had them in 2 different locations. It was very slow.  After we moved them our speed improved significantly.

Some things to check (some of these are listed in the link above):
Ignore ACL rules (sitewide)
Ignore "limit per store" rules (sitewide)
Ignore discounts (sitewide)
Ignore featured products (sitewide)
Delete unused plugins
Set "MultipleActiveResultSets=True"
Set web.config to debug = false out on production server
6 years ago
Chrome's developer tools show that your homepage is 16.2 MB which is a massive amount of html. Looking at the [url=view-source:http://eshop.krassaspiaggio.gr/]generated source of the page[/url] you can see that the majority of the html that's being served to the browser is taken up by the Κατηγορίες (Categories) menu which is only displayed at mobile resolutions by the responsive design.

This set of nested unordered lists contains your entire category structure which is very large so probably takes a significant amount of time to be generated by the server (though that might depend on whether it makes use of caching or is populated fresh from the database on each page request).

I'd try temporarily removing the mobile version of your category menu and see what effect that has on the site performance. If it helps you could then look at replacing it with something similar that only loads the top level categories initially and loads the child categories as required via ajax.

Another thing I noticed is that you're using 32 bit png files for the category images like this one: http://eshop.krassaspiaggio.gr/content/images/thumbs/0000550_CAPONORD_420.png. These are all around 100-200 KB each but you're presenting them on a white background anyway so you're not really making used of the alpha channel in the 32 bit png. If you were to change them all to jpegs on a white background I expect you could reduce the file sizes by at least 90% which would lead to a significant improvement in download times.
6 years ago
petemitch wrote:
Chrome's developer tools show that your homepage is 16.2 MB which is a massive amount of html. Looking at the [url=view-source:http://eshop.krassaspiaggio.gr/]generated source of the page[/url] you can see that the majority of the html that's being served to the browser is taken up by the Κατηγορίες (Categories) menu which is only displayed at mobile resolutions by the responsive design.

This set of nested unordered lists contains your entire category structure which is very large so probably takes a significant amount of time to be generated by the server (though that might depend on whether it makes use of caching or is populated fresh from the database on each page request).

I'd try temporarily removing the mobile version of your category menu and see what effect that has on the site performance. If it helps you could then look at replacing it with something similar that only loads the top level categories initially and loads the child categories as required via ajax.

Another thing I noticed is that you're using 32 bit png files for the category images like this one: http://eshop.krassaspiaggio.gr/content/images/thumbs/0000550_CAPONORD_420.png. These are all around 100-200 KB each but you're presenting them on a white background anyway so you're not really making used of the alpha channel in the 32 bit png. If you were to change them all to jpegs on a white background I expect you could reduce the file sizes by at least 90% which would lead to a significant improvement in download times.


Thanks to all of you guys for your suggestions. I finally speeded it up quite a lot.
I added the cdn plugin and the most important of all: I filtered, as petemich suggested, the mobile category menu by just showing the top menu categories every time. this was made from file Nop.Web\Views\Catalog\TopMenu.cshtml line 17
(category.SubCategories :)
has been changed to
category.SubCategories.Where(x => x.IncludeInTopMenu).ToList() :


Could you please let me know if there is any easy method of converting the >100KB pngs to jpgs?

Thanks again.
6 years ago
petemitch wrote:
Chrome's developer tools show that your homepage is 16.2 MB which is a massive amount of html. Looking at the [url=view-source:http://eshop.krassaspiaggio.gr/]generated source of the page[/url] you can see that the majority of the html that's being served to the browser is taken up by the Κατηγορίες (Categories) menu which is only displayed at mobile resolutions by the responsive design.

This set of nested unordered lists contains your entire category structure which is very large so probably takes a significant amount of time to be generated by the server (though that might depend on whether it makes use of caching or is populated fresh from the database on each page request).

I'd try temporarily removing the mobile version of your category menu and see what effect that has on the site performance. If it helps you could then look at replacing it with something similar that only loads the top level categories initially and loads the child categories as required via ajax.

Another thing I noticed is that you're using 32 bit png files for the category images like this one: http://eshop.krassaspiaggio.gr/content/images/thumbs/0000550_CAPONORD_420.png. These are all around 100-200 KB each but you're presenting them on a white background anyway so you're not really making used of the alpha channel in the 32 bit png. If you were to change them all to jpegs on a white background I expect you could reduce the file sizes by at least 90% which would lead to a significant improvement in download times.


Thanks to all of you guys for your suggestions. I finally speeded it up quite a lot.
I added the cdn plugin and the most important of all: I filtered, as petemich suggested, the mobile category menu by just showing the top menu categories every time. this was made from file Nop.Web\Views\Catalog\TopMenu.cshtml line 17
(category.SubCategories :)
has been changed to
category.SubCategories.Where(x => x.IncludeInTopMenu).ToList() :


Could you please let me know if there is any easy method of converting the >100KB pngs to jpgs?

Thanks again.
6 years ago
https://www.imagemagick.org/script/index.php can help
6 years ago
ilich_x86 wrote:
https://www.imagemagick.org/script/index.php can help


Thanks for this tool. I assume that I need to download the png images, convert them to jpeg, then upload them back to production site and update the filenames in db, correct?
6 years ago
You can also open _productbox.cshtml and remove all @Html.Widget(.. you find.

It will help a lot.
6 years ago
Hi again, despite the fact that times dropped a lot, the first time load after some time is very slow again, then the next loadings are very fast. Is there any keep alive feature in nopcommerce?

Thanks again.
6 years ago
Hi again, another method where I am getting out of memory exception is in product edit page:

Exception of type 'System.OutOfMemoryException' was thrown.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

Source Error:


Line 139:@helper TabCategories()
Line 140:{
Line 141:    @Html.Partial("_CreateOrUpdate.Categories", Model)
Line 142:}
Line 143:@helper TabManufacturers()


Source File: c:\inetpub\vhosts\krassaspiaggio.gr\subdomains\eshop\httpdocs\Administration\Views\Product\_CreateOrUpdate.cshtml    Line: 141


I think it is the following code in ..Presentation\Nop.Web\Administration\Controllers\ProductController.cs file:

var allCategories = _categoryService.GetAllCategories(showHidden: true);
                foreach (var category in allCategories)
                {
                    model.AvailableCategories.Add(new SelectListItem
                    {
                        Text = category.GetFormattedBreadCrumb(allCategories),
                        Value = category.Id.ToString()
                    });
                }

Do you have any ideas how I could improve performance?
Thanks in advance.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.