Load Time Speed Optimization Guide Needed

Hi All -



NEW to CS Cart - been helping to build the web for 15 years though, so I guess I’m not new to this. :slight_smile:



I have NOT purchased the license for CS Cart yet - and hope some of the more experienced users can help me understand WHY the cart takes so long to load, as well as provide tips on what THEY have done to achieve the ~3 second, initial page load time.



Once the initial start page loads (Whether its the welcome page to the public or welcome to admin) - everything else about this cart is perfect! That initial page load is a killer though… :confused:



I have a dual core Xeon dedicated server with 4gb of RAM, php5+, MySQL 5.0.81, and only have (2) installs of CS cart 2.08 on it… that’s all. (One for beta, one for live, neither is registered or licensed yet, due to this load time issue)



[COLOR=Red]Update: License purchased and installed.[/COLOR]



Anyhow -



The initial “First-page” load time can take up to 8-10 seconds on first load of the day.


  • I loaded my test environment with 40 products, 200 product images, and literally not much else.
  • I DO have SEO URL’s ON
  • I have deleted references in the style sheets to files not found (there are 5 instances of 404 images in the “basic.css” sheet)
  • I have minify’d the js files.
  • I have removed ALL non essential “Add-ons”
  • Disabled ALL AJAX (Which is one of the reasons I LIKE this cart)
  • I have walked through several other areas, trying to optimize as much as I could.



    Also -



    I have visited SEVERAL of the signature stores of many of the forum readers and contributors - its truly a mish-mash of load times, but some of you have SUPER FAST loads on your sites.



    That is my goal of starting this thread - I have read several others, but none seem to have a step by step process of speeding up the initial load time.



    Thanks in advance…

Only a longshot, but I wonder if considering you are running in demo mode, if an initial call is being made to CS-Cart to validate it’s use which is why the initial page load is so slow?

@ Struck -



I had considered that also. If thats the case, CS should document that single thing as a contributing factor for the slow load speed. I can imagine many developers who investigate using CS would balk with that initial load.



The large project I am working on, is for a total 25-30 sites within the next year - if I cannot get the load issue with CS worked out soon, I am going to be forced to look at other solutions.



The 10-15 second “first-page” load issue will turn away prospective buyers quickly.



Thanks,

Hello Niche,



I understand your initial concerns & frustration as I absolutely have like ZERO tolerance for slow shopping cart programs!



If you haven’t already, I would send a quick email to CS-Cart support and ask them if running in demo mode would have any effect on the initial load time.



However, although I cannot see anything wrong on your end as it seems you have easily covered the majority of potential problem areas, there is absolutely no doubt that you will get your initial page loads in that 2-3 second range! We are on what I consider an entry level VPS (both site files as well as Mysql are on VPS) & consistently see 2-3 seconds initial load with 1-2 seconds for all pages afterwards.

So, don’t throw in the towel! :wink:

Also, in case you have not tried this, within your config.local.php file, adjust the maximum memory limit to match your available resources:



// Set maximum memory limit

@ini_set(‘memory_limit’, ‘128M’);

Thanks Struck!



I am pretty committed to making it work - it has all of the features I have searched for through trial and tribulation of several other carts over the past several weeks.



I have a failrly lengthly deployment on tap - and hope this is just a small hiccup.



I have already bumped the php.ini up to 256mb (versus the standard 64mb) as well as memory limit to 256 to match it. No change.



I have been able to speed it up a little - its ONLY that initial 'first-page" load that kills me!



It looks like it is storing relay.cs-cart.com sessions in the db, so it may in fact be validation related.



Thanks again -

Just thought I would jump in and update this post.



After several testing sessions, a talk with my dedicated server provider, and quite a bit of tweaking, I have reduced load time to -2 seconds from a non-cached, never before load on the site.



Considering my homepage is OVER 400k in size with images and a separate load of jquery, I am finally happy! If you recall, the initial load time when I first installed was +12 seconds.



What I did:



1 - On the server itself, I set the php.ini to 256mb, and matched it in the config file of cs-cart.



2 - On the server, I had a dedicated server guru look at the DNS resolver. (/etc/resolv.conf) and set a higher priority. This alone eliminated 7 seconds off the load time, and the site went from 10-13+ seconds of “First Page” load, to just over 4 seconds.



3 - Used the Minify, gZip and compression functions of the JSmart utility from this post in the forum. (Second post by babalucci) This had the second largest impact on performance, reducing another 2+ seconds from load time.



4 - Used the following tools for testing:


  • Firebug for Firefox
  • YSlow for Firefox (Now gets a B score, which is good enough for me)
  • Pingdom load test - 4.3 seconds)
  • Uptrends worldwide load test (Tests load time across multiple IP’s in different countries) - Average 1.9 seconds across all resolved test locations.



    Anyhow - I just wanted to follow up and mention that it can be reduced signifigantly with some extra efforts.



    If anyone cares to see the site - it can be seen at OverstockAve.net. Which is just a temporary location during the development.



    Mark

Good Job Niche, now your cookin with gas!



Can’t get a full featured cart program to run much faster (if any) than that! :wink:



Did you need to do anything special to setup/install the JSmart utility considering Babalucci’s post was over a year old?



I would really like to try that out on our site to see what speed improvements we may achieve!

@ Struck -



Thanks for the vote of confidence! :slight_smile:



1 - I grabbed the utility from here, which is now called SmartOptimizer.

2 - Uploaded it to the box (I upload everything to a storage folder on the box, and keep pure, unedited versions in that folder)

3 - Copied the /smartoptimizer/ folder over to the root of the store folder. (public_html/smartoptimizer/)

4 - Instead of using the htaccess provided, I copied the contents of it, and simply pasted them above the existing cs-cart htaccess. (I also keep a copy of the original htaccess, renamed htaccessBAK, in case of “Oops”)

5 - Made sure the smartoptimizer/cache/ folder had the correct permissions to write to the cache.



Let it rip!



Worked flawlessly - basically just followed the directions on the SmartOptimizer website.



Mark

Very good

My site after upgrade 2.06 to 2.08 was very very slow now with SmartOptimizer its’ ok

Thx very much

After my upgrade 2.06 to 2.08 Test with http://tools.pingdom.com





Total loading time:

11 seconds

Total objects:

52 (501.3 KB)

External objects:

2 (11.2 KB)

HTML (X)HTML:

1 (70.9KB)

RSS RSS/XML:

0

CSS CSS:

7 (98.1KB)

Scripts Scripts:

8 (159.3KB)

Images Images:

36 (173KB)

Plugins Plugins:

0

Other Other:

0

Redirected Redirected:

0











After SmartOptimizer







Website information



Total loading time:

4.6 seconds

Total objects:

52 (206 KB)

External objects:

2 (0KB)

HTML (X)HTML:

1 (71KB)

RSS RSS/XML:

0

CSS CSS:

7 (59KB)

Scripts Scripts:

8 (76KB)

Images Images:

36 (0KB)

Plugins Plugins:

0

Other Other:

0

Redirected Redirected:

0

Hello,



Have you tried eliminating the Search within categories (bottom and top),

just keeping the normal search ?



Can you please comment me after doing it.

So with some great advice and help from a few carty locals (mainly Brandonvd and Spiral) I set out under taking the task of dropping my sites load times down.



Full page loads according to pingdom were at around the 20 second mark mainly due to the shared hosting account the server was on which was throttling apache connections to 10 at a time. I switched to a VPS and load times instantly dropped down to around 12-15sec.



Step 1. I installed the Yslow and PageSpeed addons for Firebug/Firefox and started going down the list. Compressing images, combining javascript and css, specifying image dimensions, etc.



[url]Firebug

[url]http://developer.yahoo.com/yslow/[/url]

[url]http://code.google.com/speed/page-speed/[/url]



Step 2. Installed smartoptimizer and minified/gzipped 90% of the site



[url]http://farhadi.ir/works/smartoptimizer[/url]



Step 3. Server side tweaking and apache/cache optimization, further image optimization.



(Thanks Spiral!)



Step 4. This was probably the hardest of all. I ran my site through the w3c validator and I had around 250 HTML errors/warnings between all of my pages. I’m now down to 2 errors and those are intentional. Then I started cleaning up CSS and with some help was able to do a decent job (still a little left to do here).



[url]http://validator.w3.org/[/url]

[url]http://jigsaw.w3.org/css-validator/[/url]





So the end result…



Pingdom now shows my average full page load time is under 6 seconds (I actually hit 4.9 seconds tonight which for my image/flash heavy site is really good)



Uptrends shows my average page download time for the US is under 1 second and for the rest of the world is under 2 seconds.



[url]Website Speed Test | Pingdom Tools

[url]http://www.uptrends.com/aspx/free-website-server-network-monitoring-tool.aspx[/url]



Ive got some more tweaking and CSS cleanup to do, but the results speak for themselves. “They” say if you page takes longer than 10 seconds to load you

ll lose 60% of your sales. Site optimization definitely seems worth it.

Correct me if I’m wrong, but doesn’t everyone’s website load up within 10 seconds?



Home Page
- My result was 6.1/6.2 seconds.

[URL]Website Speed Test | Pingdom Tools



Product Page
- My result was 8.8 seconds

[URL]Website Speed Test | Pingdom Tools

[quote name=‘JesseLeeStringer’]Correct me if I’m wrong, but doesn’t everyone’s website load up within 10 seconds?



Home Page
- My result was 6.1/6.2 seconds.

[URL]Website Speed Test | Pingdom Tools



Product Page
- My result was 8.8 seconds

[URL]Website Speed Test | Pingdom Tools



I guess it would depend on whats on your page and possibly your host. In my case my host was limiting simultaneous apache connections to 20 at a time and then it would throttle for 5 seconds (I said 10 above but it was 20). So every 20 items that loaded the page throttled for 5 seconds. Im sure this isnt common practice but Im sure Im not the only one with the issue.

Thanks! I would give it a try!

Thanks for the links… I ran Uptrends and every location in the US loaded up in under 1.4 seconds … This is running 2.0.12 on a VPS

I’m going to give my 2 cents about increasing initial first page load time. I was having the same issue and even worse, I got more than 30 seconds and sometime more than 60 seconds to load my home page with clearing the cache. I thought it was my ISP’s problem or my hosting server’s problem. In deed, I found it was one of the CS-Cart Add-ons which calls Access restrictions causing this issue. After I disable it, my site just loads super fast without any optimization.



Here is my demo site address: [URL=“http://www.cybbay.com/demo/index.php”]http://www.cybbay.com/demo/index.php[/URL]



I’m guessing it may have some coding issue with this add-on.

Just tried smart optimiser with 2.0.14 and it was working weird like some javascript or css got messed up.



I went back to:







SetOutputFilter DEFLATE









ExpiresActive on

ExpiresByType image/png “access plus 1 month”

ExpiresByType image/jpeg “access plus 1 month”

ExpiresByType image/gif “access plus 1 month”

ExpiresByType image/ico “access plus 1 month”

ExpiresByType text/css “access plus 1 month”

ExpiresByType application/x-javascript “access plus 1 month”

[quote name=‘TexasGuy’]Just tried smart optimiser with 2.0.14 and it was working weird like some javascript or css got messed up.



I went back to:







SetOutputFilter DEFLATE









ExpiresActive on

ExpiresByType image/png “access plus 1 month”

ExpiresByType image/jpeg “access plus 1 month”

ExpiresByType image/gif “access plus 1 month”

ExpiresByType image/ico “access plus 1 month”

ExpiresByType text/css “access plus 1 month”

ExpiresByType application/x-javascript “access plus 1 month”

[/QUOTE]



Texasguy,



Here is what our .htaccess file looks like & currently working very well with 2.0.14 and Smartoptimizer:


```php DirectoryIndex index.html index.php







ExpiresActive On

ExpiresDefault “access plus 10 years”







RewriteEngine On



RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(..(js|css))$ smartoptimizer/?$1





RewriteCond %{REQUEST_FILENAME} -f

RewriteRule ^(.
.(js|css|html?|xml|txt))$ smartoptimizer/?$1







RewriteCond %{REQUEST_FILENAME} -f

RewriteRule ^(.*.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt))$ smartoptimizer/?$1







FileETag none







RewriteEngine on

Some hostings require RewriteBase to be uncommented

Example:

Your store url is http://www.yourcompany.com/store/cart

So “RewriteBase” should be:

RewriteBase /store/cart

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !.(png|gif|ico|swf|jpe?g|js|css)$

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php?sef_rewrite=1 [L,QSA]



RewriteCond %{REQUEST_FILENAME} ./catalog/.

RewriteCond %{REQUEST_FILENAME} -d

RewriteCond %{REQUEST_FILENAME}/index.html !-f

RewriteRule . index.php?sef_rewrite=1 [L,QSA]



```



After installing Smartoptimizer, you may need to clear the CS-Cart Cache & the Smartoptimizer cache as well so that everything gets off on the right foot.