Menu Close

    Joomla Speed Performance Optimization

    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

    Start your headless eCommerce
    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 Features

    • SmartOptimizer increases your website download speed by reducing the size of JavaScript and CSS files approximately up to 80% or even higher.
    • 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.
    • If your website has a large amount of JavaScript and CSS files, SmartOptimizer reduces your monthly bandwidth usage amazingly.
    • 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.

    Intallation Requirements

    • PHP 4.3.0 or higher.
    • Apache with mod_rewrite is recommended.

    Installation Instructions

    • 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.)
    • if Apache mod_rewrite is not enabled or if your web server is not Apache, you should change all of JavaScript and CSS urls used on your website from “path/to/file/filename” to “smartoptimizer/?path/to/file/filename”.
      See the following examples :
      Script tag:

      <script src="smartoptimizer/?path/to/file/jsfile.js"></script>

      CSS link:

      <link rel="stylesheet" href="smartoptimizer/?path/to/file/cssfile.css" />

      CSS @import rule:

      @import url("smartoptimizer/?path/to/file/cssfile.css");
    • Note that the folder structure must be something like this:
    • to use concatenation feature, the files should be placed in the same place. and links to the files should be like the following examples:
      <link rel="stylesheet" href="path/to/file/cssfile1.css,cssfile2.css,cssfile3.css" />
      <script src="path/to/file/jsfile1.js,jsfile2.js,jsfile3.js"></script>

    Known Issues

    • 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.

    Configuration Options

    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 :

    Download smartoptimizer

    Back-end optimization :

    Please refer this URL for the back-end optimization


    . . .
    Discuss on Helpdesk

    Leave a Comment

    Your email address will not be published. Required fields are marked*

    Be the first to comment.

    Back to Top