X-Cart Mods, X-Cart Addons - WebsiteCM
Did you know...
We offer a Community Forum to learn, build, and share with other users of x-cart software?
X-Cart Excellence eZine
Subscribe for proven tips and special discounts!
Cart is empty
View X-Cart Mods
Filter MODS BY VERSION
XCart Mods (4.1.x)
XCart Mods (4.0.x)
XCart Mods (3.5.x)
XCart Mods (3.4.x)
View All
Mods By Purpose
Mods By Firm

X-Cart Speed Tips


For all x-cart's strengths, speed is certainly not one of them. There are however steps you can, and should, take to speed up your x-cart. Here is the most complete listing of x-cart speed optimization tips available. Thanks to NuAlpha, B00MER, Connor and Emerson for their contributions:

Administration Changes

The following changes can be made in your X-Cart admin section:

  • Ensure your images are in the file system, not in your database.
  • Disable extra functions and modules that you do not need.
  • The Advanced Statistics module slows down x-cart by storing statistical information in the database. We highly recommend you disable the advanced statistics module and use a log file analyzer and/or a program such as Marketing Manager.

Files/Setup

  • Move javascript to .js includes and css to .css includes so that they can be better cached.
  • Optimize your html code so that it is clean and efficient, limit your use of tables, and optimize the size of your images and product thumbnails.
  • X-Cart provides an addon called "Fancy Categories" - don't use it.
  • If you use a linux server, edit/create your .htaccess file to include the following:

    php_flag zlib.output_compression On
    php_value zlib.output_compression_level 2
  • Smarty provides a method to increase speed by caching the templates so they do not need to be recompiled. This should NOT be used when you are making changes to your site templates, as no template changes will be recognized while the check is disabled. So if making changes, you will need to ensure this variable is set to "true."

    You can enable template caching by opening the file "Smarty.class.php" in your smarty directory and editing this variable to "false":

    /**
    * This tells Smarty whether to check for recompiling or not. Recompiling
    * does not need to happen unless a template or config file is changed.
    * Typically you enable this during development, and disable for
    * production.
    *
    * @var boolean
    */
    var $compile_check = true;

Database

Server Level

If you are on a dedicated server you will have access to do the following, if not, you may need to speak to your web host.

  • Install Zend Optimizer and Ioncube.
  • Ensure your server has lots of RAM.
  • Have your MySQL settings optimized for your particular needs.
  • Use linux's "top" function to monitor your server load. If your server load is above 1.00 and it cannot be lowered with optimization, it is too high and you may want to look at a hosting/server upgrade.

Additionally

  • When programming your site, or hiring someone else to program for you, make sure you/they know what you/they are doing! It is very dangerous for a coder to know enough to modify code but not enough to modify it correctly.
Authored by Jon Peters, founder of WebsiteCM, specializing in providing X-Cart mods, X-Cart addons and x-cart development services since 2002.

Article copyright 2007 WebsiteCM.com and may be republished provided all content is left intact including author information, copyright notice and website links.
 Previous: X-Cart Design Next: X-Cart Resources 

Comments on: X-Cart Speed Tips [Share Your Comments]


Charles I was losing lots of customers due to long page loading times, this article was exactly what I needed.

Thank you very much!
Moses Thank you so much for the time you guys spend writing these articles for x-cart, I seriously wouldn't be able to administer my x-cart store without you!
Alan What I'd suggest with websites that are heavily graphics based...don't worry about

php_flag zlib.output_compression On
php_value zlib.output_compression_level 2

as your flash, image and video files don't get compressed, and it's just unnecessary server loads on your site.
Jon Peters If you wanted to apply compression to html and php pages only, so as not to compress your flash, images, videos, etc., you can use:

<FilesMatch ".(html|php)$">
php_flag zlib.output_compression On
php_value zlib.output_compression_level 5
</FilesMatch>
Nelson What should be the best option for mysql? Does x-cart uses transactional tables?
Colin McNulty Thanks for this article.

I struggled with the compression thing. Whenever I followed the instructions here, I got 500 Internal Server errors across the whole site, with this in the logs:

> Invalid command 'php_flag', perhaps mis-spelled or defined by a module not included in the server configuration

In the end I found this line in the php.ini file:

zlib.output_compression = Off

And changed it to:

zlib.output_compression = On
zlib.output_compression_level = 2

It's a shame to lose the ability to not compress images & videos etc, but this has reduced my homepage total filesize by 25%
Erik Hallander Very comprehensive guide, I could follow all these steps without stumbling over my own feet at any point.

Bit curious about Fancy Categories though, that's not something that comes with X-cart by default right? Couldn't find any references to it in my store ;)

Thanks!
Jon Peters Hi Erik. Fancy Categories for X-Cart is an x-cart addon and does not come with x-cart by default.


Share Your Comments:


Your Name:
Comments:

Type the characters you see in the picture. (If you do not see any picture here, please enable images in your web browser options and refresh this page):

Get a different code
digg
technorati
Delicious
Reddit
Google Bookmarks
Furl it!

Live Help

Site Map