CodeClouds Color Logo

MAGENTO | 20 May 2019

Basic Tips for Magento Performance Optimization

In this video we’ll go over a few quick tips to optimize your magento storefront. There are some basic things you can with your Magento installation that will give an immediate performance improvement.

We cover the following things in this video:

Page Cache

Ensuring page cache is properly enabled prevents the site from having to re-generate a page every time it’s needed.

Flat Tables

Enabling flat tables provides a performance boost by making it faster to retrieve product information from the database.

Merge and Minify Javascript and CSS

Merging and minifying our javascript and CSS files means that we will have lest requests to server and less data to deliver. Though this somewhat overlaps with Gzip compression, this performance boost also works for browsers that don’t support Gzip compression.

Gzip Compression

Gzip compression will reduce the size of what the server has to deliver by 50% or more typically. This is because the server compresses it before sending it, and the end users browser unpacks it. With a large amount of concurrent customers, this can provide huge performance gains.

You’ll need the following rules for this section of the video

AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/plain

AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE application/x-javascript

AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/xml

AddOutputFilterByType DEFLATE application/xml

AddOutputFilterByType DEFLATE application/xhtml+xml

And this code block

<Directory /var/www/html/>
<IfModule mod_mime.c>
AddType application/x-javascript .js
AddType text/css .css
</IfModule>
<IfModule mod_deflate.c>
 
AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/plain text/xml application/javascript
 
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
</IfModule>
</IfModule>

Header append Vary User-Agent env=!dont-vary

</Directory>

 

Database Caching

For best results, you’ll want to use a 3rd party tool like Varnish. Magneto 2 does come with a built in database caching, and that is better than no caching.

In the video, you’ll need the code below for this section

<type name="Magento\Framework\App\Cache\Frontend\Pool">
<arguments>
<argument name="frontendSettings" xsi:type="array">
<item name="page_cache" xsi:type="array">
<item name="backend" xsi:type="string">database</item>
</item>
<item name="place cache id here" xsi:type="array">
<item name="backend" xsi:type="string">database</item>
</item>
</argument>
</arguments>
</type>
<type name="Magento\Framework\App\Cache\Type\FrontendPool">
<arguments>
<argument name="typeFrontendMap" xsi:type="array">
<item name="backend" xsi:type="string">database</item>
</argument>
</arguments>
</type>

 

Outside of what’s discussed in the video, there are a few things you can look at as well, like making sure your hosting environment is the right choice for your needs, and making sure your code is optimized.You can find a full written article on Magento 2 performance optimization here.

php jobs in Kolkata

If you need a Magento storefront built or your existing one maintained or optimized, you can rely on the expert Magento developers at CodeClouds! Contact us today to learn more.

If you are experienced with Magento or simply an expert with PHP, see our careers page, we currently have openings for php jobs in Kolkata.

Originally written May 20, 2019. Last updated September 8th, 2020

 Views

Written by Jacob Clancy

Jacob has a bachelor's degree in web development, and his interests and experience go beyond just coding.

  • facebook
  • twitter
  • linkedin
  • pinterest
  • whatsup
Related Articles
Should You Migrate to Magento 2? (2020)

MAGENTO | 09 November 2020

Should You Migrate to Magento 2? (2020)

The Magento landscape is changing. Today we’re talking about what 2020 is bringing to the infamous eCommerce platform.

Magento Web Apps—what they are, and where to build them

MAGENTO | 03 September 2019

Magento Web Apps—what they are, and where to build them

If you own a Magento store or if you're considering developing one, you've probably asked yourself whether there's an easy way to make web apps. Don't worry: Magento have got you covered.