Child pages
  • Performance Parameters
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Performance

This page combines many tools and tips that might help you improve your shop's performance server-wise – not sales-wise, although a server that performs well is able to serve more customers, and therefore make more sales.

Smarty

Smarty is the name of the template language used by PrestaShop's themes. You can learn more about it at http://www.smarty.net/.

There are four options:

  • Template cache. For better front-end performance, PrestaShop caches your HTML pages.
    • Never recompile template files. Only enable this if you are making edits theme, and need to see your changes every time you reload your page.
    • Compile templates if the files have been updated. PrestaShop is able to see when a theme file has changed, but this might not always work as expected.
    • Force compilation. The normal behavior: HTML pages are compiled and cached, even if the theme has changed.
  • Cache. This option makes it possible for you to disable all file caches, and not just the one pertaining to template files. Only disable this if you debugging a theme or a module for PrestaShop. Otherwise, you should leave it enabled.
    The "Clear Smarty cache" makes it possible to delete the cache in a single click instead of having to go delete files on your FTP server.
  • Debug console. PrestaShop enables you to display the Smarty Debug Console, which gives you valuable information on a template page. Read more about it at http://www.smarty.net/docsv2/en/chapter.debugging.console.tpl. Note that the console opens in a pop-up window: make sure to make your browser allow them for your shop's domain name.
    • Do not open console. The default setting. No one sees the console, not even you.
    • Open console with URL parameter (SMARTY_DEBUG). The console is only displayed if you add ?SMARTY_DEBUG at the end of the URL (or the key of your choice, see below). This is great, but once your tests are done, do revert to the default setting, as this "trick" is known and some hackers could make use of it.
    • Always open console. The "full on" setting. Everyone who has access to your shop can see the console. Therefore, keep it for maintenance sessions.
  • Debug console Key. You can change the key in order to be the only one to know what key to enter in order to display the debug console.

Because the debugging console might display private information, make sure to only enable it when in maintenance mode. Do not keep it enable on a production store.

Optional features

Some PrestaShop features can be disabled if you do not use them, as they can slow down your shop.

If your catalog currently has products which make use of these features, then you will not be able to disable them. You will have to delete some data before you can turn them off.

You can disable the following features:

  • Combinations. Product combinations enable you to have a whole product line out of a single product: varying size, colors, capacity, etc.
  • Features. Product features enable you to indicate the product's specific information: weight, material, country of origin, etc.
  • Customer groups. Customer groups enable you to group customers in order to give them certain privileges and restrictions: discount, module restrictions, etc.

Combine, Compress and Cache (CCC)

CCC is a set of tools aimed at minimizing server load and theme loading time.

It does what it says: it combines textual files of the same type into one bigger files, which makes for fewer files to download; it then compresses the file using the common Zip algorithm, which makes for faster downloads; finally, it caches the compressed file, so that the server does not have to do this process every time a page is loaded, which relieves the burden on the server's processor.

Your theme must completely compatible with at least PrestaShop 1.4, otherwise CCC will not work as expected. This is why most options are disabled by default.

  • Smart cache for CSS. CSS files are text-based, and can be safely combined and compressed.
  • Smart cache for JavaScript. JavaScript files are also text-based, but their combination can sometimes prove problematic. Make sure to test everything before leaving that setting enabled.
  • Minify HTML. The HTML code generated by Smarty can be minified, meaning that PrestaShop will remove all whitespace in order to save a few bytes. This is mostly safe.
  • Compress inline JavaScript in HTML. Some themes have JavaScript code directly within. You can either leave it alone, or have them compressed. Again with JavaScript compression, make sure to test everything before leaving that setting enabled.
  • Apache optimization. This setting will change your web server's configuration file in order to make it more efficient for CCC.

Media servers

This section enables you to redirect part of your traffic (image and video files, for instance) to other servers under your control, through other domains or sub-domains – most often, the files are hosted on a CDN (Content Delivery Network). By default, PrestaShop supports up to 3 media servers.

Putting your store's domain name in those fields is not the proper way to get fantastic performance. That being said, it is easy to set up a media server, and the benefits are real and almost immediate. Here is how:

  1. Open an account at a new host, preferably one who is specialist of distributed content. The most popular are Akamai (http://www.akamai.com/), Amazon (with its AWS services, among which is CloudFront: http://aws.amazon.com/) or CloudFlare (http://www.cloudflare.com/). You should also ask your own host, maybe it has a CDN service you can subscribe to.
  2. Copy your media files to that host's server. This means that the CDN server must contain an exact copy of the following folders from you store's main server: /img, /themes and /modules.
    Reminder: you must make it so that these folders are always synchronized: even if you you add new products or change your theme, the CDN server must contain the latest version of all these files.
  3. Once the CDN server is in place, add the web address (as given by your CDN host) in the first field, "Media server #1". If that host allows for more web addresses, add them.

In case you would rather that your files are still visually downloaded from your domain name rather that from an unknown domain name, follow this process:

  1. Create a subdomain for your store's domain name, for instance http://cdn1.mystore.com (the way to do that depend on your host, ask him about it).
  2. Put a .htaccess file at the root of the subdomain. That file should contain a single line:

    Redirect Permanent / http://cdn-adresse.com


    Replace the http://cdn-adresse.com with the one from your CDN server. This way, you are creating an automatic redirection from your subdomain to your CDN server.

  3. Once the subdomain is in place, add it in the first field, "Media server #1". If that host allows for more web addresses, create as many subdomains to your store's main domain name.

Cyphering

Cyphering means encrypting data so as to render it unreadable to unwanted eyes. Your costumers' account details, as well as your own, are protected by cyphering.

Here you can choose the algorithm you prefer:

  • Use Rijndael with mcrypt lib. Default choice. Fast and secure, but requires you to have the Mcrypt extension installed with PHP.
  • Keep the custom BlowFish class. Better security, but performance takes a toll, as it takes more time to validate the authentication, for each page load. Your customers might appreciate the added security, but might not like the time spent waiting for the page to load – although the time difference is really unnoticeable to most.

Therefore, choose wisely. If you change this configuration, all cookies will be reset.

Caching

Your server's cache stores static versions of your dynamic web page, in order to serve these to your customers and thus reduce server load and compiling time.

Most of the time, you should first check with your web host about this setting, as it requires special settings on the server.

This section enables you to choose to enable caching, and then choose the caching method:

  • File system. The static files are simply stored as any other file, on your server. This displays a field set to "1" by default. This is the file-system directory depth. Only change this value when you know what you are doing.
  • Memcached. A distributed caching system. Very effective, above all with multiple servers, but you need to make sure that your servers/hosts support it – most probably, if your PHP configuration features the Memcached PECL extension, you are good to go (you can download it here: http://pecl.php.net/package/memcache). You can add Memcached servers by clicking on the "Add server" link.
  • APC. Alternative PHP Cache is free, open and robust, but only works with one server – which is the usual case when you start your online business. Again, check for the availability of the APC PECL extension on your server: http://pecl.php.net/package/APC.
  • Xcache. Xcache is a new cache system, which is specific to the Lighttpd server – hence, it will not work with the popular Apache server. Read more about it at http://xcache.lighttpd.net/.
  • No labels