How to optimize Magento website performance
Magento if the most widely used e-commerce framework. In this post I have mentioned few important points through which we can optimize overall Magento website’s performance. Most optimizations will work with any version of Magento. Note that here I assume your customized Magento website is build by following all the recommended coding standards (For more information about Magento coding standards please visit http://devdocs.magento.com/guides/v2.0/coding-standards/bk-coding-standards.html). So, following are important points/guidelines you are supposed to follow to improve Magento performance.
- Enable Cache through Magento Admin Panel.
- Use minified js/css and enable Merge CSS/JS through Magento Admin Panel
- Enable code compilation after complete development. If updates, code modifications, extension installations are needed, code compilation needs to be disabled first. If not, there will be errors.
- Set HTTP Header Field Connection : Keep-Alive through server configuration.
- Do not take backup or place other folders in servers “/var/www/html/” other that project’s main folder.
- Use PNG images.
- Apply lazy loading on images.
- Reduce HTML source code by removing spaces, commented text and make HTML inline, this helps to render page fastly by browser.
- Enable Flat Categories and Products: In Magento admin, (top menu) System > Configuration, (left nav) Catalog > Catalog, (main page) Frontend. Set “Use Flat Catalog Category” and “Use Flat Catalog Product” to “Yes“. Attributes that apply to Categories and Products are stored in separate database tables depending on their datatypes. ‘Flattening’ will put all attributes in one table for Magento retrieve. This will have a positive impact on site speed especially if it has 1,000 or more products.
- Optimize the MySQL server (enable Query Cache and tweak my.cnf parameters).
- Enable gzip through server configuration and note that you don’t apply it on images as images are already compressed.
- As part of database maintenance do log cleaning.
- Use 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 Xcache.
Rules for improving web page response time :
Studies have shown that web page response time can be improved by 25% to 50% by following these rules.
- Minimize HTTP Requests
- Use a Content Delivery Network
- Avoid empty src or href
- Add an Expires or a Cache-Control Header
- Gzip Components
- Put StyleSheets at the Top
- Put Scripts at the Bottom
- Avoid CSS Expressions
- Make JavaScript and CSS External
- Reduce DNS Lookups
- Minify JavaScript and CSS
- Avoid Redirects
- Remove Duplicate Scripts
- Configure ETags
- Make AJAX Cacheable
- Use GET for AJAX Requests
- Reduce the Number of DOM Elements
- No 404s
- Reduce Cookie Size
- Use Cookie-Free Domains for Components
- Avoid Filters
- Do Not Scale Images in HTML
- Make favicon.ico Small and Cacheable
Comments
Post a Comment