Optimizing Prestashop is something I spend a lot of time on, in fact it is something that I specialize in. Everyone has their own opinions of what you can do to make your Prestashop store the fastest. I have spent weeks testing different set ups and I can tell you without a doubt what you can do to make your Prestashop store the fastest it can be.

We now offer PrestaShop speed optimization as one of our services. The button below will take you to all of our different speed optimization packages.

View Optimization Packages

Get a VPS account

This is the foundation of a fast site. Shared hosting will not let you do the things described in this article, so you need to have a good VPS account. I always suggest WebHostingBuzz for hosting, they have fast servers and provide excellent support. A couple notes to hosting that I would like to mention. I do not recommend using hosts that are “cloud hosts” or instance based hosting. The reason being Prestashop requires processing power and memory. These type of hosts seem to allocate memory, but not processing power. I always recommend people to select a host that is transparent with how much processing power you have allocated to your account. Terms like 8x or 16x processing power mean absolutely nothing to me. What are they 8x or 16x of? I prefer knowing what resources I actually have at my disposal. With WebHostingBuzz I know that I am actually getting processor cores with a VPS account and I know what the processors are.


Another suggestion is to stay away from using SSD drives for doing these things I am going to mention, they are a waste of money and will actually slow some of the more important database queries down. You will have better performance at a host that has their drives set up in a raid 10 configuration. Trust me on this one, I will explain it more in depth later.


The base server setup

For your base server setup I recommend using Apache 2.2, PHP 5.4, and running PHP in Fastcgi. In WHM you should be able to build this set up with EasyApache. I also recommend installing mod_pagespeed as well.


Once you have these installed on your server, you will need to install Pecl so your WHM can access the Pecl extension library. The main extension that you want to install with Pecl is APC.


Zend optimizer has replaced APC in PHP 5.5 and also APC does not work in PHP 5.5. Don’t worry though, that is why we installed PHP 5.4, from my tests with Prestashop APC is a far superior Opcache than Zend or as it is called in PHP 5.5 opcache is.


What an Opcode cache does is pretty simple. When a user access your site, the PHP files are retrieved from disk, then compiled to Opcode, and then executed. An Opcode cache keeps the files compiled in memory and just waits to execute them . So you have essentially cut out a disk read, one reason that an SSD drive is not needed. In most cases SSD drives are faster reading from disk, but if you are not using disk, then you do not need them.


Here are the settings that I use for APC. These settings are for a small store with not a lot of products. These are good settings for you to start out with, you might need to increase them if your cache is filling up and things are getting pushed out too quickly.

The most notable values that I am using is that the cache size is 128mb. If you have a larger site you might have to increase this value. I would start moving it up in 128mb increments until your cache stabilizes. Also I have turned the slam defense off as well, it can cause errors being written to your Apache error log. Once you have APC installed, install the apc.php file so you can see how well your site is utilizing the cache.

Once APC is installed and working, you can check your apc.php file to see how your cache is doing, it looks like the image below.

Fastest Prestashop APC


Optimize some files

Mod_pagespeed is an Apache module made by Google to automatically apply some of the Google Page Speed suggestions to your site. Once it is configured it automates the the process of several things that will make your site load faster. Below is a sample configuration that I use for mod_pagespeed.

This configuration does several things here is a short list of what it will do.

  • Takes the white space out of the html resulting in smaller files
  • Removes the comments from the html, resulting in smaller file size
  • Removes the quotes on html elements resulting in smaller file sizes
  • Combines and compresses your css files resulting in fewer http requests and smaller files sizes
  • Moves your Javascript to the footer of the page and compresses it, resulting in smaller file sizes and quicker site loading
  • Compresses your images which results in smaller file sizes
  • If possible it will load Javascript libraries from Googles cdn, which makes your site faster with parallel downloads and also the file could already be cached on the users machine

It does a few more things but those are the main things which it accomplishes.

One note, if you install mod_pagespeed and get an entity ref error, the reason is more than likely that you have the convert_meta_tags filter on. Turn it off, it does not play nice with the Javascript that Prestashop uses in the head of the site. If that does not fix things set the pass through level to on and start enabling filters one by one.


Lets load files faster

What is the quickest way to load files? From memory! If you load files from memory you will get screaming fast performance. The easiest way I have found to load static files is by setting up a reverse proxy on the site. There is actually a WHM module that works really well for setting up a Varnish / Nginx reverse proxy for hosting your static files. It is called Apache Booster. You should install this in your WHM panel. Once you get it installed, this is what I recommend using for your Varnish configuration file.

One thing to notice, the max age on the static files is set to 90000 seconds. If you update any of the static files on the shop such as change a css file or regenerate your images, you will have to invalidate your cache.

To test if Varnish is installed correctly you can go to isvarnishworking.com and enter your websites address. When you enter a page it should look like this.

Varnish Prestashop


What this means is that Varnish is not caching your page files. You do not want Varnish to cache them, the way that Prestashop and other e-commerce programs work it will cause problems if the pages are cached. What you are wanting is for the static files to be cached. Try entering one of your image file addresses in the box on isvarnishworking.com and it should look like the image below.

Prestashop varnish Working

Some notes about memory usage and other limits

For a site with moderate traffic I would recommend about 2gb of dedicated memory. I usually set the memory at 512mb for php, 128mb for APC, 256 mb for Varnish, and 128mb for the query cache in MySql. The rest of the memory should be left for Apache services and for mail. The limits that you use will totally depend on how large your site is. If your Varnish cache fills up quickly, you should increase it as much as  you can to keep files cached. If you have lots of products and modules running you might have to up your APC cache as well, but Prestashop is fairly compact and I haven’t had to raise a shop over 128mb yet. If you are developing a shop and want a real true speed test, I would recommend using New Relic. They have a free tier which will give you a lot of information about how your site loads, without muddling things with network traffic.


Some notes on hosting

Not all hosts are created equal and not all VPS packages are created equal. Here is a short list of VPS providers that I would not recommend.

  • A2 Hosting – Their managed VPS accounts do not give you root access, you will need root access to do most of the things that I mentioned here. They do have un-managed hosting, but they do not offer CPanel on their un-managed accounts. You still can set most of these things up without CPanel but it takes more time and skill.
  • Hostgator – They also do not give you root access using their VPS accounts, so most of the things are not possible.
  • Ramnode – They do offer SSD drives and CPanel licenses with root access, but from my tests their accounts do not have the processing time allocated to them for a quick shop.
  • Godaddy – They do offer Cpanel access, but their MySql servers are not hosted locally. This is actually a major reason not to use them, their database latency times jump all over the place, you have no control over them.


Some notes on Prestashop settings

The more modules that you have installed the more resources that your shop will consume and the more processing power that your shop will need. I recommend disabling any module that you are not using and uninstalling the module. Also some other recommendations;

  • Disable your shop stats. Stats are nice, but using a properly configured Google Analytics account you can get most of the information that you need. Using the stats consume resources and make MySql calls to your database. I generally disable them.
  • I also recommend disabling the minifying html and compressing of Javascript in Prestashop. One, if you are using the mod_pagespeed you will not need this, two out of all of the settings these two add the most time to a being processed on the server.
  • Turn error reporting on before you launch your shop and correct any errors that are being reported. Errors in modules will slow the shop down.
  • Don’t use a htaccess file. Move the directives from your htaccess file to your httpd.conf file. Loading a htaccess file takes time, having the settings stored in the httpd.conf file will load them from the memory cache and will speed things up on the site.
  • Using the default specials and new products blocks will result in a lot of database requests, disable them if you can.


Notes on Google Page Speed, Yahoo Yslow, and GTmetrix

The tips that they give on these sites do not generally speed anything up server side. Think of a website in these terms. The server generates information and sends it to the user. In that transaction their is two places for bottlenecks. The first bottle neck is the server generating the site, the second bottleneck is the users computer decoding the information. Tools like Yslow and Google Page Speed only help speed up the user’s decoding of the files that are sent. They do absolutely nothing for the time it takes your server to process and compile your site. Most of the advice in this article is geared towards getting your site processing faster and delivering content to the user faster.

To illustrate the point, look at this graphic below, it only registers and 82 in the page optimizations, yet it is faster than 93% of loaded sites. http://tools.pingdom.com/fpt/#!/8mQQj/http://bijouthings.com

Fastest Prestashop