![]() |
How To Optimize X-Cart For Speed And Performance
For all X-Cart's strengths, speed is certainly not one of them. There are however steps you can and should take to have your X-Cart running faster and performing better.
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, Google Analytics, and/or a program such as Marketing Manager. Optimization (X-Cart 4.4.2+) X-Cart 4.4.2 and greater features an Optimization settings section under the General settings admin section. We recommend enabling the following: Do not check if templates are changed (Smarty compile_check) Do not delete empty strings in templates Use cached buy_now.tpl template calls Do not log changes in PHP configuration settings Do not use product international descriptions on all the product related pages (only if using a single language) Use new module initialization routine Check Your Benchmarks X-Cart benchmarking will allow you to see how much time your PHP, Mysql, and Smarty load times are taking. You can check this without presenting the stats to your customers as follows: Open top.inc.php Find: Code:
#Code:
// WCM - Speed OptimizationScroll down to the bottom of the page, and you should see benchmarks. Your total time should be less than 1 second, and ideally around 0.40 seconds or less. If your load times are higher than 1 second, you'll want to do some analysis on what is causing the processing delay and possibly consider moving to a more powerful web server. Compression Compression works essentially by removing spaces in data to deliver the same content faster as a smaller package. If you're running an Apache server, we recommend the following code which can be added to your .htaccess file to enable compression: Code:
# WCM - Speed OptimizationCaching can have a dramatic effect on the speed of your site by preventing content from having to be constantly redelivered to the user. When caching is enabled, a copy of the file is saved to and delivered from the user's computer. If you're running an Apache server, we recommend the following code which can be added to your .htaccess file to enable caching: Code:
# WCM - Speed OptimizationRemove ETags ETags are bits of information sent from your web server to the user's browser which is used to validate files. By removing the ETag header, you essentially force the browser to rely on your Cache-Control and Expires header as set in the code above. If you're running an Apache server, we recommend the following code which can be added to your .htaccess file to remove ETags. Code:
# WCM - Speed OptimizationMove javascript to .js includes and css to .css includes so that they can be better cached. If using X-Cart 4.4.2 or greater, use the {load_defer} X-Cart function for loading. 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" or "Flyout Menus" - don't use it. Use CSS sprites for layout design wherever applicable. Database It's very important to optimize all of your X-Cart tables in your database on a regular basis. This can be achieved using a program such as PHPMyadmin often available as part of your webhosting control panel, or in latter X-Cart versions in the "X-Cart Admin -> Tools -> Maintenance -> Optimize Tables" section. Images Using images with larger file sizes than needed can be one of the biggest speed blunders and is one of the easiest to fix. All of your site images, including layout and product images, should be optimized for the web. Check the PNG, JPG, and GIF formats, and determine which provides the best balance of quality and file size before finally saving the file. Content Delivery Network (CDN) When a user accesses your website, they connect to your web server where it is located. If you have a web server hosted in the Eastern United States, a person in the Western United States will experience slower access than a person from the Eastern United States. A CDN sets up delivery points at different points across the globe and delivers static content from the point closest to the person requesting the information. This can drastically increase speeds, especially for your international visitors. Server Configuration 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 the Linux "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. Enable mysql query caching. 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. |
| All times are GMT +8. The time now is 03:35 AM. |
Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.