13 tips to speed up Magento

13 tips to speed up Magento

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.

Latest Version

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.

  1. Install a fresh version of the Magento file tree
  2. Run the installer from the file tree on top of the outdated database
  3. 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.

Utilize Caching

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.

Image Optimization

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.

Concatenate CSS and JavaScript Files

Magneto version <2 actually has a built in feature to concatenate your CSS and JavaScript files into one file. This will reduce your total number of HTTP requests and in turn help speed up the loading of your pages.

  1. Navigate to “System”  “Advanced”  “Developer”
  2. Under “JavaScript Settings” and “CSS Settings” change the dropdown to “Yes” and click on “Save Config”
  3. 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.

  1. Navigate to “System” “Tools”  Compilation
  2. 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.

  1. Navigate to “Stores”  “Configuration”  “Advanced”  “System”  “Log”
  2. Under “Save Log, Days” change it to 14 days, or whatever you prefer
  3. Click on “Save Config”

You can also manually clean up your database by emptying the log tables.

  1. In phpMyAdmin select all of the log_% tables and select “Empty” from the drop-down box.
  2. Click on “Yes” when it asks you if you really want to TRUNCATE the tables.

Fewer Extensions and Modules

Just like with WordPress and any other platform, the more extensions you have running the more HTTP requests there are, as well as additional CSS and JavaScript files having to load. It is best to keep your Magento install down to as few extensions as possible.

You can also disable modules that you don’t use

  1. Navigate to “Stores”  “Configuration”  “Advanced”
  2. On the modules you just need to select “Disable” from the drop-down box and click on “Save Config”

MySQL Configuration

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

Update Indexes

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.

  1. Navigate to “System”  “Index Management”
  2. Select all of the indexes( or the ones you want to update), choose “Reindex Data” from the dropdown and click “Submit”

PHP Accelerators

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.

Conclusion

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.

Back to blog