Very common question for a Joomla user “How to speed up Joomla” .Basically any site including joomla consist two phase of optimization
1 – Front end optimization
2- Back-end Optimization
Front-end Optimization : We are using “Smartoptimizer” from last 2 years for the front end optimization . So what is Smartoptimizer
now. Read More
SmartOptimizer (previously named JSmart) is a PHP library that enhances your website performance by optimizing the front end using techniques such as minifying, compression, caching, concatenation and embedding. All the work is done on the fly on demand.
SmartOptimizer is open source and released under the terms of GPL (GNU General Public License).
- SmartOptimizer reduces count of http requests by concatenating JS/CSS files together.
- It also reduces http requests by embedding CSS images and CSS imported files.
- SmartOptimizer generates minified, compressed, combined and embedded files on the first request and caches them on the server and uses the cache on future requests.
- It doesn’t embed duplicated urls (i.e. css sprites) in css files for better performance.
- It also knows to regenerate already cached files if the originals have been changed.
- SmartOptimizer handles browsers that doesn’t support gzip encoding and sends them non-gzipped content.
- It also forces the browser to cache the files optionally forever or until they have not changed.
- SmartOptimizer removes Etag headers. (for better performance on clustered servers).
- It is very easy to install and usually there is no need to do any changes on your codes.
- PHP 4.3.0 or higher.
- Apache with mod_rewrite is recommended.
- Extract archive file and copy smartoptimizer folder to your website.
- SmartOptimizer will need write access to the cache folder (placed in smartoptimizer folder).
- if Apache mod_rewrite is enabled on your website, you should place .htaccess file beside smartoptimizer folder. and if your website already have a .htaccess file, you should properly modify it to add required rules. (to do this copy smartoptimizer htaccess contents and paset it inside your current htaccess at the begining of the file.)
See the following examples :
<link rel="stylesheet" href="smartoptimizer/?path/to/file/cssfile.css" />
CSS @import rule:
- Note that the folder structure must be something like this:
/public_html .htaccess /smartoptimizer /cache config.php index.php
- to use concatenation feature, the files should be placed in the same place. and links to the files should be like the following examples:
- Embedding feature only works when minify is enabled
- Since some PHP parsing occurs per request, CPU overhead is higher that serving plain uncompressed JS and CSS. So It may not be efficient for very high traffic sites.
SmartOptimizer has a configuration file named config.php.
The following configurations can be defined in this file. However it works with default configurations.
- debug: true or false.
By setting this option to true, In case of error a message containing error details will be alerted.
So it will be very helpful setting this option to true if SmartOptimizer doesn’t work for you (that it may be due to a misconfiguration or bad installation).
- charSet: utf-8 or iso-8859-1
The character set encoding of your js and css files.
- baseDir: base directory for your files
This should be typically root path of your site.
SmartOptimizer prevents including files from outside of this directory.
- serverCache: true or false
You can disable server side cache by setting this option to false (useful for development and debugging purposes).
- serverCacheCheck: true or false
By setting this option to false, once a cached file is created, always will be read from cache and will not be checked for changes (for better performance).
- clientCache: true or false
You can prevent the browser from caching the files at client side.(useful for development and debugging purposes).
- clientCacheCheck: true or false
By setting this option to false, the browser will not check the server for the changes an always uses its own cache. (for better performance).
- cacheDir: the directory where the cached files will be stored.
SmartOptimizer needs read/write permissions on this directory.
- cachePrefix: prefix for the cache files
Typically there is no need to change this option.
- gzip: true or false
You can disable/enable gzip compression through this option.(useful for development and debugging purposes)
- gzipExceptions: an array of file formats.
This is an array of file formats that should not be compressed when gzip compression is enabled.
- minify: true or false
you can enable/disable minify functionality through this option.
- concatenate: true or false
you can enable/disable concatenate functionality through this option.
- separator: File names separator
to use concatenate functionality you should separate file names with this separator.
- embed: true or false
you can enable/disable embedding functionality through this option.
- embedMaxSize: number of bytes
The maximum size of an embedded file. (use 0 for unlimited size).
Download Smartoptimizer :
Back-end optimization :
Please refer this URL for the back-end optimization http://webkul.com/joomla-tutorial/memcached-in-joomla