Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Speed Up Your CS-Cart eCommerce Website - Step 2 Rate Topic   - - - - -

 
  • Lee Li Pop
  • Senior Member
  • Members
  • Join Date: 07-Mar 08
  • 941 posts

Posted 20 October 2010 - 05:59 PM #1

Hello All,

Here is step number two, where it's discussed about the installation and use of Smartoptimizer.

The installation and use of Smartoptimizer, were summarized and commented extensively on this forum, I urge you to read and put into practice the advice given, for example, on this thread:

http://forum.cs-cart...63685#post63685

Why I recommend using Smartoptimizer, rather than gzip?

Because Smartoptimizer serves the CSS and Javascript files a static manner, while Gzip compress these files for each request, each page downloaded.

In terms of performance, static files are always faster than dynamic ones, so I encourage you to use Smartoptimizer, although I don't understand why SO doesn't work for The Tool:

I used the Smart Optimizer for a couple of days but I did not see any difference in page loading times. My pages already load in under 2 seconds without it anyway but the reason I removed it is because it was causing such a load on my server that my account was suspended.



Lee Li Pop

Important!

Upgrade your copy of SmartOptimizer to 1.8!

http://farhadi.ir/works/smartoptimizer

Read more:

http://forum.cs-cart....832#post100832
.
If All Else Fails, Read The Instruction Manual! Knowledge Base 2.x + CS-Cart Instruction Manual

Hosted at Pair.com since 2000. Zero hacking attempts during first 11 years... And counting!

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3966 posts

Posted 20 October 2010 - 06:45 PM #2

although I don't understand why SO doesn't work for The Tool:




Lee Li Pop


I have been able to get it to work. I believe the problem was that I already had gzip enabled and then SO was enabling it as well. I guess they were conflicting.?

 
  • E.Qi.Librium
  • Senior Member
  • Members
  • Join Date: 05-Sep 09
  • 472 posts

Posted 20 October 2010 - 07:40 PM #3

This one I already have, but, as all of you guys scared me (unintentioned of course), I turned off the gzip compression after reading this potencial conflict with smartoptimizer :sad: I really don't want to mess up my shop neither to be kicked out of my server, but maybe I'm just being paranoid :rolleyes: (please don't comment on this one...).
About smartoptimizer I can say it rocks!
Oh, and thanks again Lee for all your advices, very very usefull and needed ;) .

4.11.5


 
  • Noman
  • Senior Member
  • Members
  • Join Date: 29-Oct 07
  • 526 posts

Posted 20 October 2010 - 08:04 PM #4

I have both turned on and so far so good.
I'm Number 1, so why try harder?

CIA wannabe or having doubts and need some answers?
Spy Gadgets and CCTV Equipment

 
  • E.Qi.Librium
  • Senior Member
  • Members
  • Join Date: 05-Sep 09
  • 472 posts

Posted 20 October 2010 - 08:18 PM #5

Thanks Noman, and do you have it for a long time like that? what's your host?
Sorry for the questions

4.11.5


 
  • Lee Li Pop
  • Senior Member
  • Members
  • Join Date: 07-Mar 08
  • 941 posts

Posted 20 October 2010 - 08:21 PM #6

Hello E.Qi.Librium,

I turned off the gzip compression after reading this potencial conflict with smartoptimizer :sad:


Please, remember:

Please, note this:

If you have Smartoptimizer, add this code:

<IfModule mod_deflate.c>
<FilesMatch "\.(php|html)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>

Nota Bene:

Smartopitimizer is faster on JS and CSS than "mod_deflate" because it manages JS and CSS in static way. So, don't put these files on "mod_deflate" if you have Smartoptimizer!



Lee Li Pop
.
If All Else Fails, Read The Instruction Manual! Knowledge Base 2.x + CS-Cart Instruction Manual

Hosted at Pair.com since 2000. Zero hacking attempts during first 11 years... And counting!

 
  • moka
  • Senior Member
  • Members
  • Join Date: 09-Feb 08
  • 634 posts

Posted 20 October 2010 - 08:28 PM #7

I've tried using SO for my site and it works great, but the only problem is it breaks the css in my other domains. Any ideas on this? Thanks.

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3966 posts

Posted 20 October 2010 - 08:43 PM #8

I suppose I should have clarified that I had gzip enabled via php.ini and not .htaccess.

 
  • Noman
  • Senior Member
  • Members
  • Join Date: 29-Oct 07
  • 526 posts

Posted 20 October 2010 - 09:03 PM #9

I have it for quite a long time with modifications in .htaccess as per Lee's email. I run on it on my own VPS with Apache tweaked a bit for speed. No default settings. I couldn't spot any problems.

Thanks Noman, and do you have it for a long time like that? what's your host?
Sorry for the questions


I'm Number 1, so why try harder?

CIA wannabe or having doubts and need some answers?
Spy Gadgets and CCTV Equipment

 
  • Lee Li Pop
  • Senior Member
  • Members
  • Join Date: 07-Mar 08
  • 941 posts

Posted 21 October 2010 - 03:35 AM #10

Hello Moka,

I've tried using SO for my site and it works great, but the only problem is it breaks the css in my other domains. Any ideas on this? Thanks.


First of all, clear your browsers cache with CCleaner, or better, with CyberScrub Privacy Suite and try again.

Try this:

1 - Go to this directory on your server:

/smartoptimizer/cache

2 - Delete everything

3 - Clear your browsers cache with CCleaner, or better, with CyberScrub Privacy Suite

4 - Try again your website in your browsers

Your CSS is broken yet?

Try this:

1 - Download your UNZIPPED CSS file on your own desktop

2 - Gzip it with 7zip with these setting: GZip - Ultra - Deflate - 32 KB - 128

3 - Name it "example.css.gz"

4 - Upload your "example.css.gz" gzipped on this directory on your server:

/smartoptimizer/cache

4 - Copy (CTRL + C) the whole name of your actual CSS Gzipped file (for example: so_e90e15fd2e4f7d7a73df5075d9eaf454.css.gz)

5 - Rename your actual CSS Gzipped file (for example: from so_e90e15fd2e4f7d7a73df5075d9eaf454.css.gz to so_e90e15fd2e4f7d7a73df5075d9eaf454.css.gz.old)

6 - Rename your new CSS file, Gzipped on your desktop, from "example.css.gz" to the previous CSS Gzipped file name (for example: from example.css.gz to so_e90e15fd2e4f7d7a73df5075d9eaf454.css.gz)

7 - Do this for each CSS file.

8 - Clear the cache of your CS-Cart templates

9 - Clear your browsers cache with CCleaner, or better, with CyberScrub Privacy Suite

10 - Try again your website in your browsers


Lee Li Pop
.
If All Else Fails, Read The Instruction Manual! Knowledge Base 2.x + CS-Cart Instruction Manual

Hosted at Pair.com since 2000. Zero hacking attempts during first 11 years... And counting!

 
  • Lee Li Pop
  • Senior Member
  • Members
  • Join Date: 07-Mar 08
  • 941 posts

Posted 21 October 2010 - 03:39 AM #11

Hello The Tool,

I suppose I should have clarified that I had gzip enabled via php.ini and not .htaccess.


Could you give us your gzip settings in your php.ini?

Which could be faster? Gzip in php.ini or Gzip in .htaccess?


Lee Li Pop
.
If All Else Fails, Read The Instruction Manual! Knowledge Base 2.x + CS-Cart Instruction Manual

Hosted at Pair.com since 2000. Zero hacking attempts during first 11 years... And counting!

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3966 posts

Posted 21 October 2010 - 06:40 AM #12

Hello The Tool,



Could you give us your gzip settings in your php.ini?

Which could be faster? Gzip in php.ini or Gzip in .htaccess?


Lee Li Pop



I haven't noticed a difference between enabling gzip via php.ini vs. .haccess other than it does not create a load on the server. It has also been noted that enabling gzip via .htaccess is better than enabling gzip via php.ini.

I will have to contend that using the following will allow gzip, with the certain browsers, work more effectively. I have not determined whether it does or not compared to the gzip that you described in your other post.

<IfModule mod_deflate.c>
    SetOutputFilter DEFLATE
    <IfModule mod_setenvif.c>
        # Netscape 4.x has some problems...
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        
        # Netscape 4.06-4.08 have some more problems
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        
        # MSIE masquerades as Netscape, but it is fine
        # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
        
        # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
        # the above regex won't work. You can use the following
        # workaround to get the desired effect:
        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
        
        # Don't compress images
        # SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
    </IfModule>
    
    <IfModule mod_headers.c>
        # Make sure proxies don't deliver the wrong content
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
</IfModule>


 
  • Lee Li Pop
  • Senior Member
  • Members
  • Join Date: 07-Mar 08
  • 941 posts

Posted 21 October 2010 - 06:45 PM #13

Thank you The Tool,

In fact, I forget the "cavemen browsers" as Netscape, IE < 6 and nano niche browsers as Konqueror whom can't understand, or can't handle (or badly) Gzip.

Their share market is too low (under 0.15% in my case).


Lee Li Pop
.
If All Else Fails, Read The Instruction Manual! Knowledge Base 2.x + CS-Cart Instruction Manual

Hosted at Pair.com since 2000. Zero hacking attempts during first 11 years... And counting!

 
  • ChrisW
  • Senior Member
  • Members
  • Join Date: 05-Feb 10
  • 175 posts

Posted 30 October 2010 - 06:12 PM #14

Here's our results before and after SO.

BASE: CSC 2.0.15 on a VPS using Litespeed with PDO SqlLite caching (http://kb2.cs-cart.c...ing-performance)

BEFORE SO

YSlow: C (77%)
Pingdom:
Total loading time:
9.5 seconds
Total objects:
133 (951.3 KB)
External objects:
1 (7.3 KB)
HTML (X)HTML:
1 (101KB)
RSS RSS/XML:
0
CSS CSS:
9 (109.4KB)
Scripts Scripts:
11 (158.2KB)
Images Images:
112 (582.7KB)

AFTER SO:
YSLOW B (86%)
Pingdom:
Total loading time:
5.9 seconds
Total objects:
37 (892.2 KB)
External objects:
1 (7.3 KB)
HTML (X)HTML:
1 (101KB)
RSS RSS/XML:
0
CSS CSS:
9 (123.4KB)
Scripts Scripts:
11 (133.6KB)
Images Images:
16 (534.2KB)

A page load savings of 3.6 seconds or about 38%. What's more impressive are the number of objects and images that were reduced using SO. We used to have "white flashes" on our site when the pages loaded, no longer with SO.

Our .htaccess and SO config.php are exactly as mentioned by Struck in the forum link on SO Lee Li posted. We did add Lee Li's modeflate suggestion above.

The install was about as easy as it gets, unpack the SO archive, change .htaccess and config.php and away we went. I did not clear our cache as we are using SQLLite.

Great utility, highly recommended!

 
  • clips
  • Aged Resident Loon
  • Members
  • Join Date: 14-Jan 07
  • 1650 posts

Posted 22 December 2010 - 01:19 AM #15

Took me a while to find the download, but Lee Li Pop sent it to me and I was on my way.

If you need, you can find smartoptimizer at...
http://www.downloadp...zer_311062.html

We have now bumped our performance at gtmetrix.com from C's (about 73% on both) up to 87% on yslow and 77% on page speed.

Great suggestions and a must. Thanks for the help!

Our current host must be okay as everything so far has worked.
Regards,
Jim

 

Posted 14 January 2011 - 04:40 AM #16

Hello all, Tried to install SmartOptimizer but having issues.. When installed.. my page takes way longer to load and loads some non css, non skin version.???
Copied the instructions perfectly.. I think.. Let me know if anyone might know what Im doing wrong.. Thanks...

CS-Cart 2.1.2
I did turn on gzip thru the .htaccess... ?

Elkhorn Graphics LLC
Cs-Cart 4.11.2


 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3966 posts

Posted 14 January 2011 - 03:53 PM #17

Remove /smartoptimizer/.htaccess

 
  • lefaek
  • Member
  • Members
  • Join Date: 21-Dec 10
  • 36 posts

Posted 15 January 2011 - 01:23 AM #18

smartoptimizer is working for my 1.3.5 site on server "A" but it does not working on 2.1.12 server "B"

i have made all the changes to .htaccess
i add or not add the
<IfModule mod_deflate.c>
<FilesMatch "\.(php|html)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>

but still nothing
i use this code
DirectoryIndex index.html index.php
<IfModule mod_deflate.c>
<FilesMatch "\.(php|html)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
<IfModule mod_expires.c>
<FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt)$">
ExpiresActive On
ExpiresDefault "access plus 10 years"
</FilesMatch>
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*\.(js|css))$ smartoptimizer/?$1

<IfModule mod_expires.c>
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*\.(js|css|html?|xml|txt))$ smartoptimizer/?$1
</IfModule>

<IfModule !mod_expires.c>
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt))$ smartoptimizer/?$1
</IfModule>
</IfModule>
<FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt)$">
FileETag none
</FilesMatch>

<IfModule mod_rewrite.c>
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]

</IfModule>

i use the same code for 1.3.5 ver and it is working
it is not a cache problem as when i press ctlr+F5 it shows me the results

with smartoptimizer the ajax ("js") is not working and the template("css") is meshed up. only when i remove the "js|css" from <IfModule mod_expires.c> is working but i think this deactivates the smartoptimizer because i get the same results in gtmetrics (or other page load tester)

my site is in main root (public_html). i am using electro.i also check by add/remove the ob_start("ob_gzhandler") from index.php but still nothing

any idea please?
Find the best host for your ecommerce at JudgeHost.com

 
  • lefaek
  • Member
  • Members
  • Join Date: 21-Dec 10
  • 36 posts

Posted 15 January 2011 - 02:27 AM #19

forget it. i fix it
the problem was that it couldn't create a file into cache dir even if i had changed permission of the cache dir (and smartpotimizer dir too) to 755 and even to 777 (from both cuteftp and my cpanel).

so finally i edit the config.php at smartoptimizer and set cachedir to '' (means to root folder)

But i still don't understand the reason it couldn't write to folder. same files, same method, different server....
Find the best host for your ecommerce at JudgeHost.com

 
  • lefaek
  • Member
  • Members
  • Join Date: 21-Dec 10
  • 36 posts

Posted 21 January 2011 - 08:16 PM #20

just a thought
at the file config.php at smartoptimizer, if i change the value from false to true at the var $settings['clientCacheCheck'] then i get different page speed results but i am not sure which one to select. YSlow or Page Speed? i think page speed

so, with $settings['clientCacheCheck']=false i get at gtmetrix:
yslow/page speed : 76% / 78%

with $settings['clientCacheCheck']=true i get at gtmetrix:
yslow/page speed : 72% / 86%

see images 1 & 2

Attached Files


Find the best host for your ecommerce at JudgeHost.com