This manual is designed to offer a detailed guide to the configuration, optimisation and maintenance of a Prestashop-based online shop, using servers administered with SWPanel.
The main objective is to help the reader understand the technical and functional aspects that directly affect the performance of their online shop. Each section includes detailed information on the factors that influence loading speed, system stability, security and user experience. In addition, it includes best practices and specific recommendations to improve the operational efficiency and SEO positioning of e-commerce.
This manual covers the following key topics:
Web Hosting Server: Explains the appropriate choice of hosting type (shared or Cloud), the necessary resources (CPU, RAM, storage) and the configuration parameters (Apache, Nginx, PHP).
Database: Describes the optimal settings for the database engine (MariaDB), as well as maintenance and cleaning tasks to ensure its efficiency.
Prestashop Application: Provides details on the configuration of the Smarty system, CCC (Combination, Compression and Cache), module management and platform updates.
Web Images: Provides recommendations for image optimisation to improve website loading times and SEO.
Below, we define some concepts that will be used throughout the manual and that are fundamental to its understanding:
Prestashop: Content management system (CMS) specialised in the creation and management of online stores.
SWPanel: Comprehensive Cloud server management platform, which allows you to configure and monitor hosting services in a simple and efficient way.
Cloud Server: Virtual hosting environment offering dedicated and scalable resources for hosting web applications.
Smarty: Template engine used by Prestashop to generate the HTML content displayed to the user.
CCC: Compression and Caching. A set of techniques that reduce the size of web files and improve performance.
CDN (Content Delivery Network): A content distribution network that allows static resources (images, scripts, styles) to be delivered from geographically distributed servers to improve loading speed.
The web server is one of the most important factors when it comes to guaranteeing the proper functioning and optimisation of your online shop with Prestashop. A quality server with high availability of resources (vCores, RAM and HD) will result in faster data processing to meet visitor requests. In this way, the speed of loading the website, displaying the content in the browser and the agility in the process of responding to database queries will be much faster and more efficient. In short, a server with good performance translates into better SEO results, avoids errors on our website, improves the user experience, thus increasing their confidence and therefore online sales.
The website of an online store always demands more server resources than any other, such as a blog or a corporate website. In addition, the greater the volume of products in the online store or the number of visitors, the greater the demand for resources to respond quickly and efficiently to customer requests. For this reason, when choosing the type of web hosting for our online shop, we should take into account not only its current size, but also its future size, as one of the objectives of our e-commerce will be to increase the number of customers and sales. Currently, there are different types of hosting for an online shop, the most commonly used being the following:
a) Shared Server (Shared web hosting) - This is the cheapest hosting service as it is a server on which a multitude of websites are hosted that share the same resources (vCores, RAM and HD). The configuration parameters, corresponding to the server resources that the website can access and make use of, are always limited, so it is not always possible to adapt them to cover the configuration or performance requirements of the website. For this reason, this type of web hosting is recommended for relatively small shops, which do not have a large portfolio of products and have a low number of visitors/customers.
b) Cloud Server - This is a virtual server with high availability and guaranteed continuity of service, due to the redundancy of the infrastructure on which it is deployed and to which exclusive hardware resources (vCores, RAM, HD) are assigned, which can be scaled up at any time, making it possible to constantly adapt them to the growth needs of the online store. All the server's resources are fully available to the online shop, which means they can be completely assigned to the programming, configuration and e-commerce demand requirements. These types of Cloud servers involve a higher web hosting cost due to their higher performance and quality, so their use is recommended for online shops with a large portfolio of products, number of customers and sales.
a) CPU - Processor (vCores) - The higher the number and GHz power of the vCores assigned to the server, the better its response speed will be when executing the calculations necessary to attend to database queries, loading web content into RAM and subsequent display in the browser. In summary, a higher value in the number and speed of vCores assigned to the server translates into a better overall performance of our online store. When the number of vCores assigned to the server reaches more than 90% of its processing capacity, it begins to suffer from overload, which considerably reduces the loading speed of the online store. For this reason, the server must be provided with a sufficient number of vCores so that the sustained process load does not continuously exceed more than 60% or 70% of the server capacity, thus reserving a prudent margin in the processing capacity of the server of 30% or 40% to deal with occasional peaks and avoid process overloads that can cause the web to slow down or even stop responding. It is recommended that for a Prestashop store the Cloud server has a minimum of 4 vCores with speeds above 2 GHz.
b) RAM - RAM plays a crucial role in the performance of your online shop. It acts as a temporary storage space for the data that the processor needs in real time. When a visitor accesses your shop, the web server receives the request and the processor executes the calculations necessary to generate the content of the page. This content is transferred to the RAM, which in turn sends it to the visitor's browser for viewing.
If the amount of data generated by the processor exceeds the capacity of the RAM, the server becomes saturated and stops responding, interrupting your customers' shopping experience and negatively affecting your business.
Therefore, it is essential to correctly size the RAM of your Cloud server. As your shop receives more simultaneous visits, the demand for RAM increases. To ensure optimal performance, we recommend:
By optimising your server's RAM, you ensure a smooth shopping experience for your customers, which translates into greater satisfaction and better results for your business.
c) Hard drive capacity and type - To optimise the performance of your online shop, we strongly recommend the use of SSDs. These drives offer significantly faster data read and write speeds than traditional hard drives, resulting in smoother and faster browsing for your customers.
Key benefits of SSDs:
In addition to speed, it is crucial to correctly size the storage space of your Cloud server. The disk must be large enough to accommodate the operating system, installed software, web content and your shop's database, which will grow as traffic increases.
Recommendations for Prestashop:
By choosing SSDs and sizing the storage space correctly, you ensure an exceptional shopping experience for your customers, which translates into greater satisfaction and better results for your business.
d) Traffic limit. - When a visitor accesses your website, the server exchanges data with their browser to display the content. This exchange of data, known as traffic, has a size that providers tend to limit on a monthly basis.
What does the traffic limit imply?
The monthly traffic limit represents the total amount of data transferred between the server and your visitors‘ browsers during a month. Once this limit is reached, the server stops responding to new requests, making your website inaccessible.
Impact on your business:
An insufficient traffic limit can disrupt your customers’ experience and negatively affect your business.
Key recommendations:
By choosing a provider with an adequate traffic limit, or ideally, unlimited traffic, you guarantee that your website is always available to your customers, which translates into a better user experience and greater business opportunities.
In a SWPanel Cloud server you can adjust the assigned resources from the server administration Dashboard, as described in the following 📃 Manual: Increase and reduce my Cloud resources
Cloud SWPanel servers use Apache and Nginx web servers in tandem. Apache is configured to run behind Nginx, with Nginx acting as a reverse proxy. This configuration allows Nginx to efficiently handle static content requests, while Apache is in charge of managing dynamic requests, providing a balanced and efficient server configuration.
a) Apache web server configuration - The optimisation of the Apache web server for our Prestashop store can be done through the .htaccess file located in the root directory of our website. In this file we can define how the Apache web server will behave for such important tasks as using browser cache, increasing web security, protecting directories, etc., as well as optimising the processing and delivery of data by the browser, notably improving the performance of the server and the SEO positioning of our website.
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_item_include file .html$
mod_gzip_item_include file .php$
mod_gzip_item_include file .css$
mod_gzip_item_include file .js$
mod_gzip_item_include mime ^application/javascript$
mod_gzip_item_include mime ^application/x-javascript$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include handler ^application/x-httpd-php
mod_gzip_item_exclude mime ^image/.*
</IfModule>
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
<FilesMatch "\.(php|html|htm|txt|html5|jpg|png|js|css)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
# Disable the following parameters
<FilesMatch "\.(pl|cgi|spl|html)$">
Header unset Cache-Control
Header unset Expires
Header unset Last-Modified
FileETag None
Header unset ETag
Header unset Pragma
</FilesMatch>
b) Configuring the Nginx web server
The configuration of the Nginx server parameters for our online shop will be done from the Dashboard of our Hosting service with SWPanel.
7d
$binary_remote_addr zone=swmanuales.com_rate:1m rate=300r/s
/var/www/domain.com/cache levels=1:2 keys_zone=swmanuales.com_proxy:5m max_size=67108864
On a server managed with SWPanel you can adjust the values assigned to the Nginx parameters from the administration Dashboard of your hosting, as described in the following 📃 Manual: How to adjust the basic parameters of my hosting in a Cloud.
c) PHP parameters. The configuration of PHP parameters is one of the most important points when it comes to guaranteeing the correct functioning of the web server as well as avoiding its overload. In shared server web hosting services, these possible PHP configuration values are usually configured by default at low levels and cannot be freely increased to adapt them to the needs of our website. This is one of the reasons why we recommend hosting your online shop on a Cloud Server, as this type of hosting allows you to freely configure the PHP parameter values without any restrictions. PHP parameters can be configured through the SWPanel hosting control panel
The most important PHP parameter values to configure are:
max_execution_time = 300
max_input_time = -1
max_input_vars = 20000
memory_limit = 512M
post_max_size = 32M
upload_max_size = 32M
allow_url_fopen = on
pm.max_children = 20
On a server managed with SWPanel you can adjust the values assigned to the PHP parameters from the administration Dashboard of your hosting, as described in the following 📃 Manual: How to adjust the basic parameters of my hosting in a Cloud.
The database in our Prestashop is responsible for storing the information in our shop, organised using tables, indexes and records. It is also responsible for managing queries and access to the information stored in the tables, as well as processing and administering their content. Good configuration and efficient maintenance of the database is essential to guarantee the optimal performance of our online shop with Prestashop.
Any online shop constantly makes multiple simultaneous connections to the database to retrieve product data, prices, images, user sessions, etc. While a query to the database is being executed, for example about a product, a list of its characteristics, an image or video, ... the web remains inactive waiting for the data resulting from the query and once the database engine resolves this query the web displays the information to the user, so it is critical that the database structure and configuration is optimised to minimise the response time of the database engine, thus improving the loading speed of the web and the user experience.
In a SWPanel Cloud server, the configuration parameters of the MariaDB database engine can be modified from its administration Dashboard, where we will find the tool to modify the basic settings of the server.
a) Cache. Optimising database performance (DBPs) is just as crucial as optimising the static content of your website. Using a cache in the DBP allows you to store the results of frequent queries, preventing the server from having to execute them repeatedly.
Key benefits of database caching:
Important considerations:
Recommendations for Prestashop:
By implementing an efficient caching strategy for your database, you can achieve a significant increase in the performance of your online store, which translates into a better experience for your customers and greater sales opportunities.
The recommended values for the MariaDB database engine parameters for a server with 4 GB of RAM are as follows:
query_cache_type = ON
query_cache_limit = 128K
query_cache_size = 32M
table_open_cache = 1000
thread_cache_size = 80
host_cache_size=10000
b) Buffering. Buffering (memory space in which data is stored temporarily) is also part of the process of managing the cache of our database. The buffering values are used to adjust the parameters that work with the memory area that contains the cached data and that we have defined previously.
read_buffer_size = 2M
read_rnd_buffer_size = 1M
join_buffer_size = 2M
sort_buffer_size = 2M
innodb_buffer_pool_size = 2G
c) Additional parameters. To increase the performance of the DB we can modify other parameters such as:
performance_schema = OFF
max_heap_table_size = 32M
tmp_table_size = 32M
We can carry out this type of task on our database using database administration tools such as phpMyAdmin, HeidiSQL, MySQLWorkBench, etc. To perform these types of operations on our shop's database, we will have to execute different SQL code queries.
a) Cleaning up dynamic tables: Dynamic tables are tables where data is stored for statistical use, metrics, etc., the content of which is not essential for the functioning of the online shop (visits, connections, logs, etc.). These tables are usually filled with records on a daily basis, so they can reach a considerably large size if they are not cleaned frequently. We are going to detail those dynamic tables that should be cleaned periodically to prevent them from increasing in size too much.
Prestashop pivot tables are:
To clean these tables we can use the following SQL query:
TRUNCATE TABLE [name of the table];
For example, if we want to clean the ps_connections table we will use the following query:
TRUNCATE TABLE ps_connections;
What this query does is completely eliminate all the records in the table, leaving it totally empty.
b) Optimising and repairing tables: Many database management applications, such as HeidiSQL, include integrated tools for optimising and repairing database tables, although some actions can also be carried out manually using simple SQL queries:
To optimise tables by reorganising the table's storage structure, we can use the following SQL query:
OPTIMIZE TABLE [name of the table];
To repair the tables (only in tables with the MyISAM engine), we can use the following SQL query:
REPAIR TABLE [name of the table];
These queries only cover a small part of the process of optimising and repairing the tables. In order to solve referential integrity errors, defragment fragmented data, eliminate records with invalid values, etc., it is necessary to do so through specific software or specific modules for Presatshop, generally for a fee, although there are some free modules.
We indicate some specific Prestashop modules for database optimisation and maintenance:
This section combines tools and advice that can help you improve the performance of your Prestashop store, so that the server will be able to respond more efficiently to queries and requests from a greater number of users, and therefore you could get more sales.
These Prestashop application configuration options are available in the "Advanced Parameters\Performance" section of the administration panel (Back-office).
Smarty is the name of the template engine used by PrestaShop themes and has the following options:
Cache: This option allows you to disable the cache for all files, not just those belonging to the template files. Disable this option only for debugging modules and/or templates. In any other case, you should leave it enabled. The option “Clear Smarty cache” makes it possible to clear the cache with a single mouse click, instead of having to go and delete the files from the FTP server. It controls the use of cache files for the content displayed in the Fronted and database queries. It is very important that this option is enabled, otherwise the website's performance will be affected. It is only recommended to disable it for debugging tasks.
Multi-server synchronisation. This function allows the cache to be synchronised between multiple interconnected web servers, optimising performance in distributed web hosting architectures. When enabled, it ensures the consistency of cached data on all servers, avoiding discrepancies and improving the overall efficiency of the system..
Clear the cache. - This is the recommended option for most online shops. By clearing the cache after each modification (products, design, settings), you ensure that visitors always see the most up-to-date version of the site. This practice guarantees consistency between the displayed content and the information stored in the database, preventing visual and functional errors.
In debug mode, you can choose to reduce the impact that certain functionalities have on PrestaShop, and thus be able to accurately assess where an error is coming from. This section should only be used for error control and debugging, as debug mode slows down the loading of store items and displays existing error messages on the Frontend. For this reason it is very important to have all its options disabled while the store is in production.
If you have to activate any of these options to debug errors, the shop must first be in maintenance mode, otherwise web users may experience problems and errors while browsing the website.
Debug Mode Options:
Disable override methods. Many of PrestaShop's features can be overridden. If you enable this setting, all code overrides will be disabled, and you will be able to determine whether the problem comes from PrestaShop's own code or from a third-party module.
Debug mode. When this option is activated, technical error messages will be visible. It is useful when a person is helping someone else who does not have access to your shop but needs to know what is happening technically.
Disable non-native modules. PrestaShop's native modules are exhaustively tested so they should not present any kind of problem. If you enable this option, you will be able to determine if the problem comes from PrestaShop's own code (core or module), or from a third-party module.
Some PrestaShop features can be disabled if you don't use them, as they can slow down your shop.
If your catalogue currently has products that make use of these features, you won't be able to disable them. You'll have to delete those products to be able to disable these options.
You can disable the following catalogue features:
Combinations. Product combinations allow you to offer a wide range of variants of the same item, simplifying the management of your catalogue and improving the shopping experience for your customers. With this feature, you can present a single product with multiple options, such as different sizes, colours, capacities, materials, styles, etc., allowing your customers to customise their purchase according to their preferences..
Features. Product features allow you to provide specific and detailed information about each item: weight, material, country of origin, etc.
Customer groups. Customer groups allow you to group customers within the same group in order to give them certain privileges and restrictions: discounts, module restrictions, etc.
CCC is a set of tools designed to minimise the server load and the time it takes to load the shop's theme.
It does what its name suggests: it combines text files of the same type into one larger file, reducing the number of files to download; it compresses the file using the Zip algorithm, making it download faster; finally, the compressed file is cached, so the server does not have to do this process every time a page is loaded, which relieves the load on the server processor.
Options (CCC) Compression, Compression and Caching:
"Smart cache" for style sheets (CSS). CSS files are text files that can be safely combined and compressed. This option combines all style sheets with CSS code from modules, templates and customised code and compresses them into a single file to reduce their size and increase the speed at which their content is read.
"Smart cache" for JavaScript code. JavaScript files are text files, but combining them can sometimes be problematic. Be sure to test everything before leaving this option enabled. This option merges all JavaScript code from modules, templates and custom code and compresses it into a single file to reduce its size and increase the speed at which its content is read.
Apache optimisation. This configuration setting will modify the web server configuration file to make it more efficient for CCC. Prestashop inserts advanced code in the .htaccess file located in the main directory of the store, to make use of the browser and server cache and the compression of the website content through Gzip and Deflate.
It is recommended that all these options are activated and only deactivated for debugging or during the development phases of the online shop.
This section allows you to redirect part of your shop's traffic (images and video files, for example) to other servers under your control, through other domains or subdomains — generally, the files are hosted on a CDN (Content Delivery Network).
This is one of the techniques that most improves the performance of the site since it distributes the load of some elements of the web in different CDN servers. This means that elements such as images, templates and modules are located on other servers. In this way, when a user visits the shop, the browser requests the information that they have stored from each of these servers. This means that the load is not borne by a single server, but rather each one takes on the load of its elements.
By configuring this option, the increase in performance and the increase in the loading speed of the website is extraordinary.
In Cloud servers with SWPanel you can automatically activate the CDN service without the need to configure this section of Prestashop and only by following the steps described in the 📃 Manual: How to activate Cloudflare's CDN through SWPanel for your Hosting Service you can also apply various configuration parameters described in 📃 Manual: How to adjust Cloudflare's CDN and cache settings
The server cache stores static versions of your dynamic web pages, allowing them to be served quickly to your visitors. This significantly reduces server load and compilation times, improving the overall performance of your store.
Difference with Prestashop Cache:
Unlike the Smarty cache (native to Prestashop), the server cache is managed at the hosting level. Therefore, its configuration and management require additional considerations:
Prerequisites:
Considerations regarding Dynamic Content:
Configuration Options:
This section allows you to activate the server cache and select the caching method compatible with your hosting provider.
SWPanel users:
Key recommendations:
In short, the server cache is a powerful tool for improving the performance of your online shop, but its configuration and management require attention to detail.
It is common to increase, add to or customise the basic functionalities of Prestashop by installing modules/add-ons. The installation of these modules means adding more elements to the structure of the shop and also increasing the workload of the server, to a greater or lesser extent depending on its code architecture or functionalities. To prevent the use of these modules from causing a decrease in server performance, it is essential to provide it with the necessary hardware resources to take on the extra load.
We also recommend the following practices:
You should update your site to the latest version of PrestaShop (8.x) to benefit from performance improvements and security fixes. Keeping your PrestaShop installation up to date guarantees the benefits of the latest features and optimisations provided by the platform.
To perform the major upgrade from a version 1.6, 1.7 to the latest available version 8.x (1.8) you can use the "official module" 1-Click Upgrade which will also generate a backup of your online shop as part of the upgrade process, so that you can restore it to its original state if any unexpected errors occur.
Images are one of the main elements of a web page or online shop. In the case of online shops, each product must contain one or more images. These elements, as with the rest, have a certain size. The more size and dimension an image has, the greater the workload it generates for the server to process these elements, therefore, the longer the loading time.
It is very important to optimise the images that are going to be used on the website, as this will reduce loading times and also have a positive effect on SEO.
To reduce the size of the images, we should use file formats or extensions that compress their data while maintaining a high level of image quality. The most common formats are as follows:
Once we have decided on the format in which we are going to save the images for our online shop, we should pay special attention to their resolution. If the space reserved for displaying an image is 250px, we should create an image of exactly this size, because otherwise, if the image is, for example, 500px, it will still only be displayed at 250px and the only thing we will achieve is to increase the size of the website. For this reason we advise you to create all the images at the actual size they will be displayed on your website.
To optimise and convert the images on your online shop there are módulos de Prestashop, generally paid for, or also free of charge some web applications or specific software such as paint.net.