Speed Up Your CS-Cart eCommerce Website - Step 1

Why this topic is not sticky. Useful information. Thanks dude.

Just a quick update. I looked at jegesmaci store. It seems that the mailchimp errors were from my having an outdated version on my site that was downloaded after purchase. After he logged out/in it upgraded itself to the correct version. This is why the mismatch between line numbers in his error log and actual file data. But I could not get to his error log with info provided so I could not confirm that the errors were in fact stopped.



I have verified the version currently on my site for download as now being the latest.

I’ve been working on that account all morning Tony trying to help him to resolve a few other issues and see that those Divide by 0 errors haven’t reoccurred since the 4th.



There may be a problem with the 128MB memory limit in mailchimp_helper_funcs.php though. He has gotten a few new “Allowed memory size of 134217728 bytes exhausted” in the last couple days (that servers PHP memory limit is 256MB)… I have grepped his entire account and can find nowhere else in any coding where a 128MB limit is being set. I also haven’t yet been able to trace exactly what is requiring so much memory and why but I’m still working on it.



His error logs are in the root of the store

[quote]

here may be a problem with the 128MB memory limit in mailchimp_helper_funcs.php though.

[/quote]

It should only set it if the current value is less than 128MB.


define('MC_MB', 1024*1024);
define('MC_WANTED_MB', MC_MB * 128);
$mb = ini_get('memory_limit');
if( $mb < MC_WANTED_MB )
@ini_set('memory_limit', '128M');




I’ll add some debugging info to the mailchimp log showing what ini_get is returning at that point and what (if anything) it’s being set to.



I have to do some errands but will do this when I get back.

Good catch Scott, Bug for memory_limit was mine.

Changed:


$mb = ini_get('memory_limit');


to


$mb = str_replace('M', '', ini_get('memory_limit')) * MC_MB;




New version of mailchimp (2.1.13) has been created and will be upgraded next time it’s scheduled to do so based on client configuration (usually within 24 hours).



Now I’m late so got to run. Client’s site is updated with the change.

I can’t say enough good things about EZ-Merchant Solutions and Secure Cart Hosting. They have fantastic service and I am very please with them.



Thank you so much for helping me have a more optimized site.



Adam

Gee, unfortunately I didn’t do anything but fix one bug related to ensuring enough memory was configured. But that certainly would not have helped your performance. That your site is using more than 128MB in PHP in itself is worrisome.



Anytime there’s an issue with any of my addons, it is my responsibility to investigate and try to resolve it. I’m happy to say it doesn’t come up too often.



I’m guess Scott found something if your speed went up.

Hi Lee Li Pop

really appreciate your contributions

find them very useful and well explained.



Checked in my PHP info

don;t have mod_deflate

but have:

HTTP_ACCEPT_ENCODING gzip, deflate

under environment



what does this mean?



thanks so much!

I added


Gzip here, because my web hosting company does NOT turn on gzip “mod_deflate”.

if(!ob_start(“ob_gzhandler”)) ob_start();



to index.php and







SetOutputFilter DEFLATE







to .htaccess. HTTP Compression Test / WhatsMyIP.org says that my website is now gzipped, but when I go to Gtmetrix.com it recommends I should enable Gzip compression… and my page speed is 71%, YSlow is 68%, which I think isn’t great. Any ideas why?

Get your host to turn on the apache level mod or add it as an extension. Can’t imagine any host that would prefer to have their network swamped versus using a little more cpu. Who do you host with?

Hello Mikee,


[quote name=‘mikee’]my page speed is 71%, YSlow is 68%, which I think isn’t great. Any ideas why?[/QUOTE]



What were your results before?



We can assess the effectiveness (or not) only with the previous results.



You need to know, try to follow my advices is a long and painfull way (5 hard steps).



Or, you have the automatic easy way with WEBO:



[url]http://forum.cs-cart.com/showthread.php?t=17664[/url]



Here is a review of WEBO by Tirade:



[url]http://forum.cs-cart.com/showthread.php?t=17895[/url]



Remember what I wrote before:


[quote name=‘Lee Li Pop’]Hello The Tool,



I agree with you, WEBO is quite expensive, however, it’s a reliable plug and play module, and perfect for newbies or in hurry people.



[SIZE=“3”]My “solution” comes from my experience, nothing is guarantee, just time spent…[/SIZE][/QUOTE]





Lee Li Pop

Thanks Tbirnseth & Lee Li Pop. I host through 1clickmedia.co.uk, but I am not sure which hosting company they use themselves.



I removed the code I added to the .htaccess & index.php, just to see what my scores were before the code, and they are the same as with the code : my page speed is 71% & YSlow is 68%. Obviously HTTP Compression Test / WhatsMyIP.org says that my website is not gzipped. Have I done something wrong, or do I need to contact my hosting company to turn on the apache level mod or add it as an extension?



Many thanks.

Did you put the .htaccess code in the root of your shop? So NOT in the smartoptimizer folder?



Please see here for a step by step smartoptimizer installation I wrote some weeks ago: [url]http://forum.cs-cart.com/showthread.php?t=25136[/url]

Hello Mikee,



Open the Administration tab of your administration panel. Click on the Database link, then click on the php information link in the top left corner of the page.



Now, in the new PHP info page, could you check if this line exist:


[QUOTE]_SERVER[“HTTP_ACCEPT_ENCODING”][/QUOTE]



Is so, what is the text following?





Lee Li Pop

Hi Flow, the .htaccess file is in the root of the shop (/httpdocs folder). I don’t think I have smart optimizer installed, unless it is installed in the latest version of CS Cart.



Lee Li Pop, I do have the line _SERVER[“HTTP_ACCEPT_ENCODING”] in the php info pages, and next to it says gzip & deflate. I am wondering if I have made a mistake somewhere, maybe when adding the code (in my previous post)?



Thanks for your help!

Hello Mikee,



Very strange…



Gzip via PHP seems not to be blocked, then, you should be able to Gzip your pages. I don’t understand why your pages are not Gziped (or more accurately why your results are same exactly).



Do you feel a speed difference on displaying a page with and without this Step 1?



Two choices:



1 - Install Yslow! add-on for Firefox to check carefully your “Before” and “After” results once more time:



[url]https://addons.mozilla.org/en-US/firefox/addon/yslow/[/url]



2 - Contact your web hosting support to try to get some advices.





Lee Li Pop

Hi Lee Li Pop



I installed YSlow, and tested my site with & without the new code in index.php & .htaccess files. Unfortunately, the YSlow reading is the same, 70% :frowning:



As I mentioned before, I added the code to index.php directly under the copyright notice, and in .htaccess I added the code directly under the first line “DirectoryIndex index.html index.php”.



My site is www.capitalcaterers.co.uk , in case you can tell me if I have done something wrong? Otherwise I guess I will contact my web hosting company.



Thanks again for your help



Mike

Hello Mike,


[quote name=‘mikee’]My site is www.capitalcaterers.co.uk[/QUOTE]



Everything is OK, well, just for TEXT Gzip! Because, you are at the whole begining of 5 difficult steps, and you must go ahead right now with Step 2.



Why can I say that?



1 - Compression Verification is OK: [url]http://www.whatsmyip.org/http_compression/[/url]



2 - Line number 1 “GZip Text” is OK: [url]http://www.webpagetest.org/result/110609_QP_SMPK/1/performance_optimization/[/url]



3 - Enable gzip compression is F (29): [url]http://gtmetrix.com/reports/www.capitalcaterers.co.uk/IHWGwJdz[/url]



So, now, click on “Enable gzip compression” link to see more details. You can see CSS and JS are NOT Gziped at this moment. You’re on the way! Now, you need to Gzip them with Smartoptimizer at Step 2:



Speed Up Your CS-Cart eCommerce Website - Step 2



If you want more, you need to go with Step 3, and more!



Speed Up Your CS-Cart eCommerce Website - Step 3



Speed Up Your CS-Cart eCommerce Website - Combine CSS - Step 4



VERY important last step:



Speed Up Your CS-Cart eCommerce Website - .htaccess - Step 5



Keep confidence, there is always somebody to help you.





Lee Li Pop

Thanks so much Lee Li Pop, I shall go on to step 2 and hopefully my website can run a bit faster :slight_smile:

Hello Mike,


[quote name=‘mikee’]Fixed – I deleted the .htaccess file from the /smartoptimizer folder, and now my homepage is up to YSlow score of [COLOR=“Red”]88[/COLOR]! :D[/QUOTE]



Well, you are in the middle of the way… However, from this side of the Channel (France) your website is as fast as light.



Go to Step 3, 4 and 5, your website will be even faster. :wink:

Do you deliver Paris area? OK, so I want some Chinese Vegetable Dimsum!





Lee Li Pop