improve the performance of the site

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


```php

DirectoryIndex index.html index.php



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]





SetOutputFilter DEFLATE









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









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







RewriteCond %{REQUEST_FILENAME} -f

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





```



need to be replaced.



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



3. Things to do:[list]

[
]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.

[/list]

/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§ion_id=Thumbnails



Thumbnail format: JPEG

JPEG format kalitesi (0-100): 60



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



http://gtmetrix.com/

reports.jpg

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

blank page



Page Speed Grade:

(94%)



YSlow Grade:

(86%)

Page load time: 4.15s

Total page size: 232KB

Total number of requests: 26
















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

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](])?>[\s\t\r\n]+@si”, “$1$2$3>”, $source);

$source = preg_replace(“@(]*)?>[\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');

[quote name='StellarBytes' timestamp='1363688696' post='158109']

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

[/quote]

4.15s for a blank page. I am still failing to see where your gains are.

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(); ?>



[color=#ff0000]<?php flush>[/color]


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.

my report after the procedure:

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

[quote name=‘Flow’ timestamp=‘1367582620’ post=‘161206’]

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

[/quote]



you rock! thanks dude 8)



my results in: [url=“http://gtmetrix.com/”]http://gtmetrix.com/[/url]









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!

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



Thomas

add this: defer=“defer” in the [color=#282828][font=arial, verdana, tahoma, sans-serif][/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]and make it like: [/font][/color][color=#282828][font=arial, verdana, tahoma, sans-serif]
[/font][/color]



[font=arial, verdana, tahoma, sans-serif][color=#282828]but be careful which files you are deferring, since it can brake your sites functionality.[/color][/font]

[quote name='silverbestbuy' timestamp='1382996219' post='170508']

add this: defer=“defer” in the [color=#282828][font=arial, verdana, tahoma, sans-serif][/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]and make it like: [/font][/color][color=#282828][font=arial, verdana, tahoma, sans-serif]
[/font][/color]



[font=arial, verdana, tahoma, sans-serif][color=#282828]but be careful which files you are deferring, since it can brake your sites functionality.[/color][/font]

[/quote]



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

[quote name='silverbestbuy' timestamp='1382996219' post='170508']

add this: defer=“defer” in the [color=#282828][font=arial, verdana, tahoma, sans-serif][/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]and make it like: [/font][/color][color=#282828][font=arial, verdana, tahoma, sans-serif]
[/font][/color]



[font=arial, verdana, tahoma, sans-serif][color=#282828]but be careful which files you are deferring, since it can brake your sites functionality.[/color][/font]

[/quote]



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



Thomas

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.

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.

[quote name='soldierly' timestamp='1363682540' post='158097']



/admin.php?dispatch=settings.manage§ion_id=Thumbnails



Thumbnail format: JPEG

JPEG format kalitesi (0-100): 60





[/quote] 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.

[quote name=‘kickoff3pm’ timestamp=‘1364594130’ post=‘158975’]

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(); ?>



[color=#ff0000]<?php flush>[/color]


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.
[/quote]

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.

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.