Jump to content

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

improve the performance of the site Rate Topic   * * * * * 1 votes

 
  • soldierly
  • Member
  • Members
  • Join Date: 10-Jun 09
  • 139 posts

Posted 19 March 2013 - 08:42 AM #1

1. Things to do:

/root/config.local.tpl file

// Tweaks
$config['tweaks'] = array (
'js_compression' => true, // enables compession to reduce size of javascript files
'check_templates' => false, // disables templates checking to improve template engine speed
'inline_compilation' => true, // compiles nested templates in one file
'anti_csrf' => false, // protect forms from CSRF attacks
'disable_block_cache' => true, // used to disable block cache
'join_css' => true, // is used to unite css files into one file
'allow_php_in_templates' => false, // Allow to use {php} tags in templates
'disable_localizations' => true, // Disable Localizations functionality
'disable_google_base' => true, //Disable obsolete google base functionality
);
// Cache backend
// Available backends: file, sqlite, mysql
// To use sqlite cache the "sqlite3" PHP module should be installed
$config['cache_backend'] = 'mysql';

need to be replaced.


----------------------------------------------------------------------------------------------

2. Things to do:

/root/.htaccess file

DirectoryIndex index.html index.php
<ifmodule mod_rewrite.c="">
RewriteEngine on
# Pleas note that RewriteBase setting is obsolete use it only in case you experience  some problems with SEO addon.
# 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]
<ifmodule mod_deflate.c="">
<filesmatch "\.(css|js|php|html)$"="">
SetOutputFilter DEFLATE
</filesmatch>
</ifmodule>
<ifmodule mod_expires.c="">
<filesmatch "\.(ico|gif|jpg|jpeg|png|swf|css|js|html?|xml|txt)$"="">
ExpiresActive On
ExpiresDefault "access plus 10 years"
Header unset ETag
FileETag None
Header set Connection keep-alive
Header append Vary User-Agent
Header append Vary: Accept-Encoding
Header append Cache-Control public
</filesmatch>
</ifmodule>
<ifmodule mod_headers.c="">
<filesmatch "\.(ico|gif|jpg|jpeg|png|swf|css|js|html?|xml|txt)$"="">
Header unset ETag
FileETag None
Header set Connection keep-alive
Header append Vary User-Agent
Header append Vary: Accept-Encoding
Header append Cache-Control public
</filesmatch>
</ifmodule>
<ifmodule !mod_expires.c="">
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*\.(ico|gif|jpg|jpeg|png|swf|js|css|html?|xml|txt|pdf))$ smartoptimizer/?$1
</ifmodule>


need to be replaced.

----------------------------------------------------------------------------------------------

3. Things to do:
  • Download it from here.
  • Extract it and upload smartoptimizer folder to your web root directory.
  • SmartOptimizer needs write access to smartoptimzer/cache folder. Make sure it's writable.
/public_html/smartoptimizer/minifiers/

css.php delete this file

----------------------------------------------------------------------------------------------

4. Things to do:

/root/skins/xxxx/customer/common_templates

scripts.tpl

With this file are
{script src="lib/js/jquery/jquery.min.js"}
{script src="lib/js/jqueryui/jquery-ui.custom.min.js"}
{script src="lib/js/tools/tooltip.min.js"}
{script src="lib/js/appear/jquery.appear-1.1.1.js"}
{script src="js/editors/`$settings.Appearance.default_wysiwyg_editor`.editor.js"}
{script src="js/core.js"}
{script src="js/ajax.js"}

change
{script src="js/jquery.min.js"}
{script src="js/jquery-ui.custom.min.js"}
{script src="js/tooltip.min.js"}
{script src="js/jquery.appear-1.1.1.js"}
{script src="js/core.js"}
{script src="js/ajax.js"}

Move the js files.
lib/js/jquery/jquery.min.js
js/jquery.min.js

lib/js/jqueryui/jquery-ui.custom.min.js
js/jquery-ui.custom.min.js

lib/js/tools/tooltip.min.js
js/tooltip.min.js

lib/js/appear/jquery.appear-1.1.1.js
js/jquery.appear-1.1.1.js


----------------------------------------------------------------------------------------------

5. Things to do:

/admin.php?dispatch=settings.manage&section_id=Thumbnails

Thumbnail format: JPEG
JPEG format kalitesi (0-100): 60</ifmodule>

----------------------------------------------------------------------------------------------

http://gtmetrix.com/

Attached Thumbnails

  • reports.jpg

CSCART 4.8.1 ULT


 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 19 March 2013 - 10:24 AM #2

9.9 second load time - exactly how did this improve your page load times?!
Hire StellarBytes for CS-Cart Design & Development Services

 
  • soldierly
  • Member
  • Members
  • Join Date: 10-Jun 09
  • 139 posts

Posted 19 March 2013 - 10:41 AM #3

blank page

Page Speed Grade:
(94%)

YSlow Grade:
(86%)
Page load time: 4.15s
Total page size: 232KB
Total number of requests: 26

<script type="text/javascript" src="/var/cache/templates/js/slide.js"></script>
<script type="text/javascript" src="/var/cache/templates/js/jquery.scroll.js"></script>
<script type="text/javascript" src="/var/cache/templates/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="/var/cache/templates/js/faq.js"></script>
<script type="text/javascript" src="/var/cache/templates/js/jquery.min.js"></script>
<script type="text/javascript" src="/var/cache/templates/js/jquery-ui.custom.min.js"></script>
<script type="text/javascript" src="/var/cache/templates/js/tooltip.min.js"></script>
<script type="text/javascript" src="/var/cache/templates/js/jquery.appear-1.1.1.js"></script>
<script type="text/javascript" src="/var/cache/templates/js/jquery.tabs.js"></script>
<script type="text/javascript" src="/var/cache/templates/js/core.js"></script>
<script type="text/javascript" src="/var/cache/templates/js/ajax.js"></script>
<script type="text/javascript">


one css file
var/cache/templates/css/style_c_ed60ad8350g71926f87120dgd8b7a64.css" rel="stylesheet" type="text/css"/>

CSCART 4.8.1 ULT


 
  • soldierly
  • Member
  • Members
  • Join Date: 10-Jun 09
  • 139 posts

Posted 19 March 2013 - 10:45 AM #4

HTML %10 - %15 Compress

/rootl/core/smarty_plugins

Create a file
outputfilter.optimise.php


<?php
function smarty_outputfilter_optimise($source, &$smarty) {
$source = trim(preg_replace('/((?<!\?>)\n)[\t\s]+/m', '\1', $source));
$source = str_replace(array(' >', "\r"), array('>', ''), $source);
$source = str_replace(' />', '/>', $source);
$source = preg_replace("@[\s\t\r\n]*(</?)(!--|!DOCTYPE|address|area|audioscope|base|bgsound|blockquote|body|br|caption|center|col|colgroup|comment|dd|div|dl|dt|embed|fieldset|form|frame|frameset|h[123456]|head|hr|html|iframe|keygen|layer|legend|li|link|map|marquee|menu|meta|noembed|noframes|noscript|object|ol|optgroup|option|p|param|samp|select|sidebar|style|table|tbody|td|tfoot|th|title|tr|ul|var)([\s/][^>]*)?>[\s\t\r\n]+@si", "$1$2$3>", $source);
$source = preg_replace("@(</?)(a|abbr|acronym|b|basefont|bdo|big|blackface|blink|button|cite|code|del|dfn|dir|em|font|i|img|input|ins|isindex|kbd|label|q|s|small|span|strike|strong|sub|sup|u)([\s/][^>]*)?>[\s\t\r\n]+@si", "$1$2$3> ", $source);
return $source;
}
?>

/rootl/core/fn.init.php

	// Template objects for processing html templates
	//
	$view = new SmartyEngine_Core();
	$view_mail = new SmartyEngine_Core();

-----

	// Template objects for processing html templates
	//
	$view = new SmartyEngine_Core();
	$view_mail = new SmartyEngine_Core();
	$view->load_filter('output','optimise');

CSCART 4.8.1 ULT


 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 19 March 2013 - 11:00 AM #5

9.9 second load time - exactly how did this improve your page load times?!

4.15s for a blank page. I am still failing to see where your gains are.
Hire StellarBytes for CS-Cart Design & Development Services

 
  • kickoff3pm
  • Senior Member
  • Members
  • Join Date: 18-Aug 10
  • 682 posts

Posted 29 March 2013 - 09:55 PM #6

I don't know if anyone has mentione this but it seems to work for me.

In the
index.tpl files put this <?php flush(); ?>

</head>
<?php flush(); ?>
<body>

I've only just started tweeting my site for going live, this seem to take 25% off loading.

As I understand it the code in the header gets done then the onpage content (this should be already ceched on the client side) so your at the point your server is doing nothing but waiting for the next request (click etc). Before it can do that it has to clear the server and so your request has to wait. But if it's already clear no waiting :-)

Please make sure you test it as I am still doing.
http://matchdaymemories.com - Football Memorabilia Via Cs-Cart V3
http://www.outadwords.com - Free Marketing For You Site.
http://www.alternativestoebay.com - Join The Free Ecommerce Community.

 
  • Roto
  • Advanced Member
  • Banned
  • Join Date: 23-May 12
  • 127 posts

Posted 03 May 2013 - 08:42 AM #7

my report after the procedure:
Posted Image
...

 
  • Flow
  • Super Duper and Amazingly Sexy Senior
  • Members
  • Join Date: 13-Oct 10
  • 2236 posts

Posted 03 May 2013 - 12:03 PM #8

Well, by far the most important thing you can do still is turn on gzip. That will be a HUGE difference.

When life hands you lemons, bring on the Tequila baby!


 
  • Roto
  • Advanced Member
  • Banned
  • Join Date: 23-May 12
  • 127 posts

Posted 04 May 2013 - 06:28 AM #9

Well, by far the most important thing you can do still is turn on gzip. That will be a HUGE difference.


you rock! thanks dude 8)

my results in: http://gtmetrix.com/

Posted Image


following this thread + Gzip + SmartOptimizer

:mrgreen:

Anyway, I would like to ask you, how to complete the 100% of "defer parsing of JavaScript"? hoy have 100%

your screenshoot have: 93% 83% awesome! :-)

thanks!
...

 
  • tweaker
  • Senior Member
  • Members
  • Join Date: 03-Aug 07
  • 156 posts

Posted 28 October 2013 - 02:41 PM #10

@roto Were you able to figure "defer parsing of JavaScript" out?

Thomas

 

Posted 28 October 2013 - 09:36 PM #11

add this: defer="defer" in the <script type="text/javascript" src="/var/cache/templates/js/ajax.js"></script>

and make it like:
<script type="text/javascript" defer="defer" src="/var/cache/templates/js/ajax.js"></script>


but be careful which files you are deferring, since it can brake your sites functionality.
CS 4.3.9

 
  • BaDTaGs
  • Newbie
  • Members
  • Join Date: 25-Oct 13
  • 9 posts

Posted 29 October 2013 - 11:14 AM #12

add this: defer="defer" in the <script type="text/javascript" src="/var/cache/templates/js/ajax.js"></script>

and make it like:

<script type="text/javascript" defer="defer" src="/var/cache/templates/js/ajax.js"></script>


but be careful which files you are deferring, since it can brake your sites functionality.


way are you adding it to chached files? wont it empty when you clear the chache? can i add it to original file?

 
  • tweaker
  • Senior Member
  • Members
  • Join Date: 03-Aug 07
  • 156 posts

Posted 29 October 2013 - 05:48 PM #13

add this: defer="defer" in the <script type="text/javascript" src="/var/cache/templates/js/ajax.js"></script>

and make it like:

<script type="text/javascript" defer="defer" src="/var/cache/templates/js/ajax.js"></script>


but be careful which files you are deferring, since it can brake your sites functionality.


When you say "be careful of which files", what files are safe to do in 4.02?

Thomas

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

Posted 12 December 2013 - 03:21 AM #14

Did anyone figure out which files to change in either version 4.0.2 or 4.0.3? We are getting a 94/88 which is much better than version 2.2.5 but I would love to figure out some of the files we need to add the "defer" too.

Am I right to assume the best place to do this on is the home page? That way your initial load will be faster where most folks will enter.
Regards,
Jim

 

Posted 12 December 2013 - 06:05 AM #15

Should be the product page i guess. Since it will be the main entrance, not the home page. Eventhough "index.php" is the main entrance but people are looking for your products and click on your products not home page.
CS 4.3.9

 
  • Scott_C
  • Senior Member
  • Members
  • Join Date: 23-Jun 11
  • 452 posts

Posted 12 December 2013 - 08:26 AM #16

/admin.php?dispatch=settings.manage&section_id=Thumbnails

Thumbnail format: JPEG
JPEG format kalitesi (0-100): 60</ifmodule>


If that's a setting of 60 for thumbnail quality, I wouldn't recommend it at all. The quality of your product photos will be so low people will be turned off from buying.

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

Posted 12 December 2013 - 02:22 PM #17

I don't know if anyone has mentione this but it seems to work for me.

In the
index.tpl files put this <?php flush(); ?>

</head>
<?php flush(); ?>
<body>

I've only just started tweeting my site for going live, this seem to take 25% off loading.

As I understand it the code in the header gets done then the onpage content (this should be already ceched on the client side) so your at the point your server is doing nothing but waiting for the next request (click etc). Before it can do that it has to clear the server and so your request has to wait. But if it's already clear no waiting :-)

Please make sure you test it as I am still doing.


How did this work out on helping speed?

On the thumbnail quality, I would have to agree with Scott_C. Having it at 60 seems really small.
Regards,
Jim

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11200 posts

Posted 12 December 2013 - 09:35 PM #18

The vast majority of PHP/Apache implementations use buffered output so the php flush() has virtually no affect until either the buffer is filled or the output is at the end. You can turn off buffered output, but it will put a significant load on your server.

The best thing to do would be to identify what is loading slowly and then go after that. The vast majority of "load issues" is not really content of the page(s) but all the javascript provided by merchants that runs synchronously rather than after the "document is ready". If you have 6 of these widgets running and each takes 1 second, then you've just added 6 seconds to the load time seen by customers and/or Google.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.