Tuesday, March 27, 2012

How to speed up Joomla? (loading speed)

Jump to speed up your website..

 

 

 

 

 

 

 

 

Simply..

Gzip your website!

HOW?

From your Joomla control panel..

You can set the GZip setting here:

Global Configuration > Server > Server Settings > GZIP Page Compression

Gzipping of ouptut html as well as other text files can indeed produce very noticeable speed increases - probably far more noticeable to the end user (site visitor) than speeding up the database server from .2 of a second to .1 of a second. For the majority of users the download is the bottleneck - reducing 100KB of css to 5 or 10KB has significant benefits.


More..

A few tips to speed up your front end :

  • Optimize all your images for the web, most should come in at under 10kb. This will reduce your overall page size and mean that users on a slower connection can visit your site faster.
  • Remove "white space" from your template index.php file, all those esxtra white lines are doing nothing other than wasting bandwidth and meaning that Joomla takes longer to display. Remember the longer your site takes to load, the less people that will visit it, and stay reading for a beneficial amount of time.
  • Optimize your Css, remove un-needed stuff that does not get used. Then run it through -http://flumpcakes.co.uk/css/optimiser/ . This will have the effect of tidying it all up and making it small, again reducing load times and also your overall bandwidth.
  • Sort out your database, go into phpMyAdmin and select all the tables and repair and then optomise them. This will not damage your site and again it will make your pages load in a much quicker fashion.

More..

One way to speed up Joomla (or any other CMS with as many options) is just to utilize fewer of the features.  Many people see all the different features that are standard to Joomla and they immediately publish all of them.  My first Joomla based site had the random image module, most popular, polls, and probably a few other features it did not need.  This problem is one of site design and in my case I have been able to calm down over the past couple years and make a slimmer site that still seems to convey more information than the original.  Publishing fewer modules or having fewer features enabled decreases the number of database inquires and reduces the amount of php code that must be processed for any given web page. 


More..

Watch out for errors in your template. When you reference a file like arrow.gif and this file is non-existent, the performance of your server will drop immensly.
Take a look here and check for your websites performance:
www.websiteoptimization.com/services/analyze/
This page gives you a summary about your websites objects and has proposals how to improve it.
Joomla specific:
If your server has performance problems, don't enable gzip. This is meant to reduce the usage of bandwith, not the load on your server. The server has to encode all the files in order to send them, which only puts additional load on your page.
If you encounter serious problems and you have SEF enabled, disable it. It's often the source for performance problems
Probably most important of all: Keep your Joomla! version up-to-date!


More..

On the subject of CSS you can force compression and caching by using a bit of code like this at the start of your Stylesheet:

Code:

<?php
ob_start ("ob_gzhandler");
header("Content-type: text/css");
header("Cache-Control: must-revalidate");
$offset = 60 * 60 * 24 * 7 ;
$ExpStr = "Expires: " .
gmdate("D, d M Y H:i:s",
time() + $offset) . " GMT";
header($ExpStr);
?>
... rest of style sheet as normal here ...

Save your template as template_css.php and edit the reference to the template in /templates//index.php to reflect the new name

Code:

<link rel="stylesheet" href="/templates/<name-of-template>/css/template_css.php" />

As Hackwar said above don't force compression if your server is overloaded - but if it is not, go for it.
The normal rule of thumb with a web server is to worry about how long it is stressed, not how stressed it is.
Serving compressed content is often quicker than tying up the server for a longer period serving uncompressed content - but it varies from server to server.
Just to reiterate Hackwars comments about SEF and missing files (especially template images) with older versions of Joomla and $ambo, especially if you are using an older .htaccess file, if you have upgraded Joomla but not the .htaccess file then you should take a look at the newer htaccess files.


More..

If you have root access, install a PHP accelerator like APC.  This server is running APC and serves up more pages than you want to even think about, but it handles it gracefully thanks to APC.


More..

Actually the best way to gzip your css is just to create a file named 'template_css.php' and add the following code into it:

Code:

<?php
ob_start ("ob_gzhandler");
header("Content-type: text/css");
header("Cache-Control: must-revalidate");
$offset = 60 * 60 ;
$ExpStr = "Expires: " .
gmdate("D, d M Y H:i:s",
time() + $offset) . " GMT";
header($ExpStr);
?>
<?php include ('template_css.css'); ?>

Then change your template to reflect the name as stated before:

Code:

<link rel="stylesheet" href="/templates/<name-of-template>/css/template_css.php" />

/templates//index.php
Where:
is a placeholder for the actual location of your joomla installation.
is a placeholder for the specific subfolder for your current template.

That way you can still edit your css file through the admin panel.

Source

You can also read more here

No comments:

Post a Comment