Time and again it has been proven that Magento is the leading e-commerce platform. Enriched with a host of features, easy to use functionality, great third party support, Magento offers great extensions and customization options.

What do we love in Magento? It’s amazing functionalities.
What do we hate in Magento? It’s pathetic slow speed.

Magento 2.3 was recently released. Since the Adobe-Magento acquisition, this is the first version release for the eCommerce platform.

Well, if we are using Magento without setting it up for optimal performance in a shared hosting, we shouldn’t be blaming Magento for speed issues. There are different setups which can optimize Magento performance and boost the speed of Magento Store. Let’s find out how!

Tips to Speed Up Magento Performance

Editing .htaccess file:

Some secret of Speeding up Magento is hidden in its .htaccess file itself.  You need to carefully edit .htaccess file as given in the instructions below:

Enable Output Compression:

This mod to speed up Magento will only work if mod_deflate apache module is already installed on your server. Enabling output compression compresses text, CSS and JavaScript before it is sent to the browser. This results in a smaller download size of all the components for the browser, so Magento pages load faster. To enable output compression, find the following lines in you .htaccess file and just uncomment the appropriate lines, which will finally look like following:

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

    # Insert filter on all content
    SetOutputFilter DEFLATE
    # Insert filter on selected content types only
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
 
    # Netscape 4.x has some problems...
    BrowserMatch ^Mozilla/4 gzip-only-text/html
 
    # Netscape 4.06-4.08 have some more problems
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
 
    # MSIE masquerades as Netscape, but it is fine
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
 
    # Don't compress images
    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
 
    # Make sure proxies don't deliver the wrong content
    Header append Vary User-Agent env=!dont-vary

Enable Expires Headers

Expires Headers are used by the browser to determine how long a page component can be cached. Expires headers are most often used with images, but they should be used on all components including scripts, stylesheets and Flash..

Keep in mind, if you use a far future Expires Header you have to change the component’s filename whenever the component changes. Using a far future Expires Header affects page views only after a user has already visited your site. It has no effect on the number of HTTP requests when a user visits your site for the first time and the browser’s cache is empty. By using a far future Expires header, you increase the number of components that are cached by the browser and re-used on subsequent page views without sending a single byte over the user’s Internet connection.

To Add Expires Header, find the following line in your .htaccess file and uncomment the line if it’s commented and add “ExpiresActive on” above it.

integrate-magento-with-ERP-2

Find the following line in your .htaccess file and uncomment the line if it’s commented and add “ExpiresActive on” above it.


############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires
    ExpiresActive On
    ExpiresDefault "access plus 1 year"

ETags are a way for browsers to validate cached components across subsequent visits. They can slow down a site served from a cluster if the cluster hasn’t implemented them properly. It is best to just turn them off by setting “FileETag none”.

############################################
## If running in cluster environment, uncomment this
## http://developer.yahoo.com/performance/rules.html#etags
 
    FileETag none

Change default setting from Magento Admin:

Until now to speed up our Magento Webstore we made the modifications only in the Magento .htaccess files. To take this further we will now look into ……..Magento Admin settings.

Merge CSS and Javascript files

The following settings will merge the CSS and Javascript files, which in turn will help to minimize the HTTP request and make the response faster:

  • Magento admin -> System Configuration -> Developer -> Under “Javascript Settings”, change “Merge Javascript Files” to YES.
  • Magento admin -> System Configuration -> Developer -> Under “CSS Settings”, change “Merge CSS Files” to YES
  • Clear cache

Enable Flat Catalo

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 queries faster. If your store have more than 1000 products. You should enable Flat Catalog Products.

  • In the Magento Admin, go to System > Configuration > Catalog.
  • Under “Frontend”, change “Use Flat Catalog Category” to YES.
  • Under “Frontend”, change “Use Flat Catalog Product” to YES. (optional)
  • Clear the cache.

Enable the Magento compiler (Mage_Compiler)

Important Note: If custom extensions are being used in your Magento webstore, enabling the Magento Compiler may break the store. Use this with precaution. We would not be responsible if something goes wrong.
Magento’s application files are searched in the following order:

  • In the Magento Admin, go to System > Configuration > Catalog.
  • Under “Frontend”, change “Use Flat Catalog Category” to YES.
  • Under “Frontend”, change “Use Flat Catalog Product” to YES. (optional)
  • Clear the cache.

This search is performed every time a page loads, resulting in a lot of filesystem reads. Enabling the Mage_Compiler reduces the number of reads by copying all of the application files to a single include directory. It also caches the most frequently used pages.

1. In the Magento Admin, go to System > Tools > Compilation.
2. Click “Run Compilation Process”

Log cleaning via admin

1. In the Magento Admin, go to System > Configuration.
2. In the left menu under Advanced, click System.
3. Under “Log Cleaning”, change “Enable Log Cleaning” to “yes” and configure the Save Log for 14 days:

magento

Clean Magento database

Cleaning the database Magento time-to-time improves the performance and site load speed of your Magento eCommerce Site. You can manually clean up the database by logging in to your Magento database, and truncating the following tables:

  • log_customer
  • log_quote
  • log_summary_type
  • log_url
  • log_url_info
  • log_visitor
  • log_visitor_info
  • log_visitor_online

If implemented correctly these simple tips will help you speed up Magento store performance. Magento performance optimization guarantees that your ecommerce website will become insanely fast. Also, along with the tips, please try to ensure the following:

1. Take a dedicated SSD hosting server.
2. Use external cache such as Varnish.
3. Use CDN for your site elements.

The main conclusion is, you need to configure your Magento system and get a high performing hosting server properly optimized to get an awesomely performing Magento e-commerce store.

If you think we need to add something else to the list, don’t hesitate to write it in the comments below and also let us know if you have questions regarding implementation of the above steps. Ciao.integrate-magento-with-ERP-2

You may also like:
Magento 2.0 Advanced Pricing
Top 7 Magento Extensions in 2017 for Your eCommerce Store
How to Maintain Multi-Warehouse Stock in Magento?