Jump to content

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

How to Speed Up and Optimise CS-Cart Version 4? Rate Topic   * * * * * 1 votes

 

Posted 28 April 2014 - 11:04 PM #21

This also works and you don't have to manually change the dates..

<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>

Elkhorn Graphics LLC
Cs-Cart 4.11.2


 
  • jimmyod
  • Senior Member
  • Members
  • Join Date: 24-Apr 12
  • 459 posts

Posted 01 May 2014 - 12:26 PM #22

config.local.php has one option in 4.x - when set to true it did nothing to my GtMetrix scores of 70 page speed, 77 yslow - 'gzip_css_js' => true // gzip compiled css/js files

With 4.x do make sure you have Development Settings OFF in Design > Template Editor > Development Settings. The admin nags you if you leave them on so I doubt it's issue for anyone.

Major speed increase - I added the compression and header expire code below to my .htaccess and my score went to 99 page speed, 89 Yslow. Expires date needs to manually changed. Feels good but the question would be what impact could this have on site features and functionality?


#Expires
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)(\.gz)?$">
Header set Expires "Thu, 15 Apr 2015 20:00:00 GMT"
Header unset ETag
FileETag None
</FilesMatch>

#Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>

Will this work for v4.1.4 ?

 
  • Alt-team
  • CS-Cart Developer
  • Authorized Reseller
  • Join Date: 18-Jan 11
  • 2833 posts

Posted 06 May 2014 - 10:05 AM #23

Hello!

We have done a modification for several CS-Cart users that have 100% proven effect in site speed optimization. This is the optimization with Memcache. If someone is interested the details are here http://www.alt-team....dification.html

Best regards, Alt-team

ADD-ONS  Web development service  | CS-Cart dedicated developers

Buy MULTIVENDOR - USD 1250 (14% off)   Buy CS-CART LICENCE - USD 345 (13% off)

 Email - manager@alt-team.com | Skype - Altteam    


 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 839 posts

Posted 09 May 2014 - 04:15 PM #24

Changing my thumbnail sizes to 167 x 125 greatly increased my GTmetrix Page Speed score for the Responsive Theme. The Responsive Theme apparently strips out image sizes, so setting the thumbnail sizes to the theme's predefined sizes seems to be necessary.

CS-Cart Ultimate ver 4.11.3


 

Posted 10 May 2014 - 01:30 AM #25

I upgraded my site from version 3.0.6 to 4.1.4 today. Here are my GTMetrix scores. How can I change the "B"s to "A"s?
Screen Shot 2014-05-09 at 9.24.34 PM.png

 

Posted 10 May 2014 - 02:46 AM #26

I upgraded my site from version 3.0.6 to 4.1.4 today. Here are my GTMetrix scores. How can I change the "B"s to "A"s?
Screen Shot 2014-05-09 at 9.24.34 PM.png


Add Expired Headers as shown above..

Elkhorn Graphics LLC
Cs-Cart 4.11.2


 

Posted 10 May 2014 - 12:09 PM #27

Add Expired Headers as shown above..


OK that cut my load time down to 3.25 seconds and gave me a page speed of A. Still a B on Yslow though.

Screen Shot 2014-05-10 at 8.07.44 AM.png

 

Posted 10 May 2014 - 12:11 PM #28

I also added the Gzip code earlier in this thread and that brought my page load down to 2.9 secs. Still a B on Yslow though.

 
  • jimmyod
  • Senior Member
  • Members
  • Join Date: 24-Apr 12
  • 459 posts

Posted 10 May 2014 - 12:28 PM #29

This also works and you don't have to manually change the dates..

<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>

CarStickerDecals,
Sorry, but I am not a programmer. Do I just copy this code and paste at the bottom of .htaccess ?

 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 839 posts

Posted 11 May 2014 - 03:22 AM #30

I got the YSlow grade up to an A (90%) with SmartOptimizer. It minified some js.
I also commented out the google font in the styles.less file which wouldn't cache and disabled etags.

BTW, when you set "ExpiresDefault" to 1 month, you don't have to define anything else as 1 month because you just made 1 month default.
Those mod_expires module settings could be optimized to read:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
</IfModule>

CS-Cart Ultimate ver 4.11.3


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

Posted 11 May 2014 - 03:27 AM #31

Hey Magpie Don, were you able to get SmartOptimizer to work with version 4? I can't remember what it was, but I kept getting errors and could not get it to work.
Regards,
Jim

 
  • mrfoameruk
  • Senior Member
  • Members
  • Join Date: 03-Dec 09
  • 302 posts

Posted 11 May 2014 - 08:37 AM #32

Jimmyod. I added it at the bottom of the file. There was only one line in there anyway. Really helped the load time.

When i did gzip = true nothing seemed to happen.

Also turned off all unnecessary addons........Or should I uninstall as I heard disabled addons still take some juice?

Another thing that seemed to work and I tried it because someone had mention it in a different thread was to optimise the database. The person was trying to get this done on a cron job. When I tried it initally it did seem to help the load time.

Gmetrix does say something about adding image sizes (that's what it marks me low on).Can I /should I change something?
Dont know if this relates to what magpie don said earlir about his thumbnail size. I'm on responsive as well.
http://UKBeading.co.uk.....one day I will get round to it and stop playing......

cs cart 4.1.4

 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 839 posts

Posted 11 May 2014 - 05:15 PM #33

Hey Magpie Don, were you able to get SmartOptimizer to work with version 4? I can't remember what it was, but I kept getting errors and could not get it to work.

Yes, SmartOptimizer is copied to the v4.1.4 root directory and here is the entire contents of my .htaccess file. I'm not using the Multi-vendor version if it matters. Nothing here is specific to my domain. The code has been cleaned up, but anyone thinks there is something out of place, please do tell:
DirectoryIndex index.html index.php
php_flag zlib.output_compression Off
php_flag output_buffering Off
php_value output_handler NULL

<IfModule mod_rewrite.c>
    RewriteEngine on
    Options -MultiViews
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    AddEncoding gzip .gz
    RewriteCond %{REQUEST_FILENAME} \.(js|css)$
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}.gz -f
    RewriteRule ^(.*)$ $1.gz [QSA,L]

    RewriteCond %{REQUEST_URI} ^api/(.*)$ [or]
    RewriteCond %{REQUEST_URI} .*/api/(.*)$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .*api/(.*)$ api.php?_d=$1&ajax_custom=1 [L,QSA]

    RewriteCond %{REQUEST_URI} \.(png|gif|ico|swf|jpe?g|js|css|ttf|svg|eot|woff)$ [or]
    RewriteCond %{REQUEST_URI} store_closed.html$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*?)\/(.*)$ $2 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php [L,QSA]

    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|ico))$ smartoptimizer/?$1
</IfModule>

<IfModule mod_headers.c>
    <IfModule mod_expires.c>
        Header append Vary: Accept-Encoding
        Header unset ETag
        FileETag None
        ExpiresActive On
        ExpiresDefault "access plus 1 month"
        ExpiresByType text/html "access plus 1 day"
        ExpiresByType image/x-icon "access plus 1 year"
        <FilesMatch .*\.css.gz$>
            Header unset ETag
            FileETag None
            ExpiresActive On
            ExpiresDefault "access plus 1 year"
            ForceType text/css
            Header set Content-Encoding: gzip
            Header set Cache-control: private
        </FilesMatch>
        <FilesMatch .*\.js.gz$>
            Header unset ETag
            FileETag None
            ExpiresActive On
            ExpiresDefault "access plus 1 year"
            ForceType text/javascript
            Header set Content-Encoding: gzip
            Header set Cache-control: private
        </FilesMatch>
    </IfModule>
    <FilesMatch "\.(ttf|ttc|otf|eot|woff|css)$">
        Header set Access-Control-Allow-Origin "*"
    </FilesMatch>
</IfModule>

CS-Cart Ultimate ver 4.11.3


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

Posted 12 May 2014 - 02:23 AM #34

No luck with Smartoptimizer for us. I just tried to install again and at first i was working fine. Then when I did the gts scan all of the a sudden the page was messed up. I even tried to use just the htaccess that you showed above and at that point it gave me an internal error and nothing worked. I'm not using the multi vendor either.
Regards,
Jim

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

Posted 12 May 2014 - 02:38 AM #35

Well....I seem to have it working...for now anyway. I'm not for sure what I did. I have the cached folder set to 755 (it won't let me do 777). I just tested and it jumped the score up to 97/81. The yslow score seems to be more difficult for me to get up.
Regards,
Jim

 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 839 posts

Posted 12 May 2014 - 03:15 AM #36

I also got rid of AddThis addon and commented out the Google font in the styles.less file. Both of those elements were dragging down the YSlow score on account of no eTags and no Expires headers. I can survive without either of those 3rd party services.

CS-Cart Ultimate ver 4.11.3


 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 839 posts

Posted 12 May 2014 - 09:31 PM #37

clips, I updated my .htaccess code - smartoptimizer only needs to be run on the text files, it's redundant to run it on the images. And I had to add back in the cache validators for the .css.gz and .js.gz files. My score is now: 98/90 on v4 and 97/90 on v3. The only way for me to really increase the YSlow speed is to use a CDN. I'm not willing.

CS-Cart Ultimate ver 4.11.3


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

Posted 12 May 2014 - 10:11 PM #38

I have thought about the cdn part myself. We've been on a dedicated server for a couple of years now but we may have to wait for that level. I just do not think I have enough traffic quite yet to justify it yet.

On the Google font, I'm not so sure what this does. Does this make the font server side instead of client side? Also, if we are using a normal font do we really need it?
Regards,
Jim

 

Posted 14 May 2014 - 11:46 AM #39

Not sure what happened but my site now gets a C on Yslow.

Any ideas on how to improve that?
Screen Shot 2014-05-14 at 7.43.23 AM.png

 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 839 posts

Posted 14 May 2014 - 02:36 PM #40

@Edward, Show the contents of the YSlow tab. Maybe I can help.
@Clips, the Google font is pulled from google. If you don't use any of the fonts from Google, you don't need the link in you styles.less file.

CS-Cart Ultimate ver 4.11.3