Magento is one of the most widely used eCommerce platforms today. In this blog, we will discuss how to speed up Magento performance to ensure you don’t lose any sales due to high abandonment rate or an unsatisfying user experience.
The reason a lot of businesses choose Magento is because it is a very robust platform with a high level of functionality and customizability. It is highly scalable, meaning there would be no need to change to a different platform later on as you scale up.
According to Kissmetrics, if an e-Commerce site is making $100,000 per day, a 1 second page delay could potentially cost you $2.5 million in lost sales every year.
Follow these tips below on how to speed up Magento and keep it running fast to ensure return shoppers and sales.
It is very important that you are always running the latest version of Magento as updates generally contain bug fixes and performance improvements. There are three main steps when it comes to upgrading a Magento installation.
- Install a fresh version of the Magento file tree
- Run the installer from the file tree on top of the outdated database
- Move over themes and custom extensions from the old version to the current version
Content delivery Network
Implementing a CDN with Magento is one of the easiest ways to instantly see decreased load times. By doing this, you will ensure you are serving your assets from multiple locations around the globe so they are delivered faster to your shoppers.
There are many forms of caching that can be implemented with Magento. Many people have great success combining NGINX + APC + Memache + Varnish Caching.
Magento also comes with a built-in caching module as well, but 3rd party solutions seem to achieve better results. Make sure all Cache Types are enabled by navigating to “System” -> “Cache Mnagement”
Enable Flat Catalog
Magento uses the EAV model to store customer and product data. Enabling the flat catalog for categories and products merges product data into one table, thereby improving performance by responding to MySQL queries faster. If your eCommerce store has more than 1000 products, this can be very beneficial.
On average 56 percent of a website’s page weight is made up of images. Optimizing your product images can dramatically increase the speed of your pages as this decreases their download times. You can compress them before uploading them using a tool like PhotoShop or there are a number of extensions you can use to auto-optimize them.
For Magento version <2 users, the following extensions are available.
- TinyPNG Extension
- Compressor Extension
GTmetrix also has a Magento extension called GTspeed. It includes image optimization as well as CSS/JS concatenation and minification.
For Magento 2 users, the Image Optimizer for Magento 2 is an option.
- Navigate to “System” “Advanced” “Developer”
- After combining these files, you will need to clear the cache.
Enable Magento Compilation
Magento has a compilation feature which has been reported to sometimes give up to a 50 percent performance boost. By default, Magento’s application files are searched in a certain order everytime the page loads, which results in a lot of filesystem reads. The Magento complier reduces these reads by copying all of these files into a single include directory and also caches ones that are used more frequently.
- Navigate to “System” “Tools” Compilation
- Click on “Run Compilation Process”
Clean Up Magento Database & Logs
By default, Magento keeps logs up to 180 days. This can result in your database growing quite large. You change it to something smaller like two weeks to save space.
- Navigate to “Stores” “Configuration” “Advanced” “System” “Log”
- Under “Save Log, Days” change it to 14 days, or whatever you prefer
- Click on “Save Config”
You can also manually clean up your database by emptying the log tables.
- In phpMyAdmin select all of the log_% tables and select “Empty” from the drop-down box.
- Click on “Yes” when it asks you if you really want to TRUNCATE the tables.
Fewer Extensions and Modules
You can also disable modules that you don’t use
- Navigate to “Stores” “Configuration” “Advanced”
- On the modules you just need to select “Disable” from the drop-down box and click on “Save Config”
MySQL has its own “query cache” that it uses in Magento to help generate dynamic pages and content while improving performance. There are some recommended setting for your my.cnf file.
query_cache_type = 1
query_cache_size = 32M
query_cache_limit = 2M
And also a recommended setting for php.ini
php_value memory_limit 512M
Magento updates indexes on every object store by default, but in some cases manual updates are required. Indexes are used to speed up MySQL queries.
- Navigate to “System” “Index Management”
- Select all of the indexes( or the ones you want to update), choose “Reindex Data” from the dropdown and click “Submit”
Using a PHP accelerator is another form of caching. They increase performance of PHP scripts by caching them in their compiled state. You can use a PHP accelerator like APC, ZendOptimizer+ or Xcahce
Choose Fast Web Hosting
Choosing a reliable and fast web host can be one of the most important decisions you will make when trying to improve Magento performance. We recommend staying away from cheap shared hosting as they tend to overcrowd their servers and you will end up sharing resources between hundreds of people. We suggest going with a VPS like DigitalOcean, Linode, or Vultr. The reason is because you will be in complete control of your resources. And if you aren’t as tech savvy or don’t want to manage your servers via CLI, ServerPilot is a great control panel alternative which works with Magento and the VPS providers mentioned above.
There are many ways you can speed up your Magento eCommerce site. From implementing a CDN to caching, enabling flat catalog, image optimization, merging CSS and JS files, using the Magento Compiler, and cleaning up your database. Also, having a good web host is equally important.