Performance and monitoring

Optimise websites and applications: speed up loading and find the cause of slowness

Reviewed on 6 min read optimisation performance

These recommendations work for any application: WordPress, PrestaShop, Magento, Joomla and similar. It is not a specific guide for each one, but a list of the points that most affect speed and of the problems that most often cause slowness.

Production settings

Applications are installed with settings designed for development, not for having the website open to the public. For example, PrestaShop comes set up to recompile templates on every visit: that way you see design changes instantly, but in a finished shop it slows down every page and sends CPU usage soaring. Things like this are why PrestaShop or Magento seem slow "out of the box".

Review your application's performance options when you finish development:

  • PrestaShop: in Advanced Parameters > Performance, set Template compilation to Never recompile template files and enable the cache. You have it step by step in tips for speeding up PrestaShop.
  • Magento: put the shop in production mode with bin/magento deploy:mode:set production. Developer mode is much slower.
  • WordPress: check that WP_DEBUG is set to false in wp-config.php.
  • Joomla: in System > Global Configuration > System, turn off Debug System.

Remember that, once recompilation is turned off, when you change the theme you will have to clear the application's cache to see the changes.

Cache

Every visit runs PHP code and database queries to build the page. A caching system stores the result of whatever does not change and reuses it on the following visits, instead of repeating the whole process. The website is faster and uses fewer resources, so a small plan can handle more simultaneous traffic.

Our servers use LiteSpeed, which has its own caching plugins to get the most out of it. Use them if your application is compatible:

Use only one page caching plugin. After enabling it, check user login, forms and the checkout process.

PHP and OPcache

Each version of PHP is faster than the previous one. Use the highest one your application supports. From the cPanel PHP selector you can change version instantly and, if something fails, go back to the previous one just as quickly.

In that same selector, enable the opcache extension: it keeps already compiled PHP code in memory and in many cases multiplies performance without touching anything else.

Images, CSS and JavaScript

  • Images: resize them to the size at which they are displayed. If you need it at 200×200 pixels, do not upload a 2000×2000 one and shrink it with HTML: the visitor will download the large one anyway. Compress them too; you can do it all at once with the image optimiser in the client area.
  • CSS and JavaScript: minify them and, if the website tolerates it, combine them. Almost all caching plugins, including LiteSpeed's, do it with a switch. After enabling it, check menus, forms and the basket.

External resources

Linking to images or scripts hosted on other websites is convenient, but if that server becomes slow or stops responding, your website waits until it times out. The visitor sees a slow website even though the problem is not yours.

  • Upload images to your own hosting instead of linking to them from another website.
  • If you use external libraries (jQuery, Bootstrap, icons), load them from reliable CDNs such as jsDelivr or cdnjs, or host them on your server.
  • Remove third-party scripts (chats, pixels, widgets) that you no longer use.

Review requests in the browser

The browser console (Network tab) shows you all the requests a page makes: how long each one takes, how much it weighs, which ones return an error and whether there are files you did not know were being loaded. Sort them by time to see what is delaying the load.

If what takes time is the HTML document itself (the first request), the problem is on the server: the application takes a long time to generate the page. To see which plugin, query or external call is using up the time, use PHP X-Ray.

Plugins, modules and themes

WordPress, PrestaShop or Magento grow through plugins, modules and themes. Each one adds weight: we have seen WordPress sites with more than 100 plugins, most of which had no real use.

  • Install only the ones you really need, and delete those you no longer use.
  • Before installing one, look at its ratings and reviews.
  • Check that its developer maintains it and releases new versions: an abandoned one is also a security risk.
  • After installing a new plugin or theme, check that the website has not become slower.

Internal errors

Applications hide PHP errors so as not to show sensitive information to visitors. But an error or warning that repeats on every visit also slows things down. Temporarily enable error logging as we explain in debugging errors in PHP applications, review what appears and turn it off when you have finished.

For WordPress and WooCommerce you have all these steps in detail in the step-by-step guide to speeding up WordPress.

You may also find useful

Something wrong or out of date? Tell us and we will review it.