2. 1 Introduction
Magento is the most successful ecommerce platforms globally
accepted by developers and eCommerce owners. Despite its
popularity Magento is a quite heavy CMS and runs slowly if right
configuration and settings are not applied. This is because these
settings are not quite obvious and missed by even experienced web
developers who are not so familiar with Magento.
There are several methods that can be applied to enhance
Magento’s performance and other PHP based CMS systems. These
enhancements start from settings within Magento and go all the way
to server/hosting settings.
The few methods that are relatively easier ones and increase the
Magento page-load speed significantly are::
2 BASIC PERFORMANCE OPTIMIZATION
2.1Reduce the size of file transfer between browser & web server
A best approach to boost Magento performance is by reducing file
transfer between browser and web server.
2.2Minify JavaScript and CSS:
There are many online tools available to minify Javascript and CSS
jscompress.com,minifyJavascript.com,csscompressor.com,minifycss.co
m.Compressing the Javascript and CSS can set aside many bytes of
data and reduces downloading, parsing and execution time Quicker
download times for your users. This helps in achieving the following
pointers:
Reduce bandwidth consumption of your website.
Reduce number of HTTP requests on your server by combining
many Javascript files into one compressed file, thus reducing the
server load and allowing more visitors to access your website.
Speed up script execution times by reducing comments and
whitespace, which are not needed for Javascript &CSS execution
and thus reducing file size.
3. 2.3Optimize Images by resizing them:
If you want to your site to load faster and have your images still retain
their quality, you’ll need to optimize your images before you upload
them to your site. Select a suitable image file format and compress the
images using image compressor to lessen the bandwidth between
browser and web server. There are several image compression tools
offered online such as; imageoptimizer.net, hjpeg-optimizer.com,
JPEGMini.com etc.
2.4Enable GZIP compression
You can curb the number of bytes sent over the network considerably
by using GZIP compression that cuts down the size of HTML, CSS, and
Javascript files sent over the network by up to 75% and reduces
download time drastically.
2.5Lessen the Number of HTTP Requests
By merging the CSS and Javascript, you can reduce HTTP request. To
reduce HTTP requests and uphold a high-quality web page at the same
time. - Combine Javascript and Combine CSS files, an inbuilt feature of
Magento. - Combine Javascript and Combine CSS files: It is inbuilt
feature of magento.
Go to System > Configuration > Advanced > Developer- Set Javascript settings
and CSS Settings as Yes
2.6Combine images using CSS sprites:
By using CSS sprites, number of images can be brought down by
combining them into as less number of files as possible. It will reduce the
server requests and will bring down the number of bytes downloaded
by a webpage.
4. 2.7Expires Headers or Cache control headers
By using the expire headers or cache control headers, the number of
HTTP requests and its size can be reduced to faster page load.
2.8Enable Apache KeepAlives
Apache KeepAlives keeps the communication between server and
browser up and running when your Magento is hosted on a shared
server. It is recommended to keep it running on server so that your user’s
browser and server do not loose the communication.
2.9Reduce the number of DOM elements
High numbers of DOM elements make the page more complicated and
increase the page size. This results in increased download time and
slower access to Javascript making the webpage load slower.
Examine the alternative to bring down the DOM elements. There are
many free tools available like DOMMonster, DOMinspector to inspect
your web page and offer suggestions for enhancement.
The screen shots given below have been taken using the DOM Monster
tool. This is an instance of a healthy web page with a less number of
DOM elements.
Example
YSlow –
5. YSlow fetches all data about the page and generates a grade for each
rule, which generates the overall grade. Yslow offers great help to
design complete layout with superb load speed. Grids.css can help you
to design responsive web page where as fonts.css and reset.css assists
you to strip away the browser’s default formatting”.
2.10 Place CSS calls at top of the page and JS calls at the bottom
Always place CSS calls at top of the page and Java Scripts calls at the
bottom as it assists to boost the progressive rendering in several browsers,
thus increasing Page load speed.
6. 3 ADVANCE PERFORMANCE OPTIMIZATION
3.1Implement Required Caching Mechanisms
Enable all Magento caching mechanism by enabling all of the
accessible cache from the Magento admin panel (System –> Cache
Management).
3.2Implement opcode cache mechanism
Memcache is a high-performance, distributed memory object caching
system. This caching mechanism assists to get better Magento heavy
traffic hits on your database by caching data away from it. Magento
supports Memcache is not enabled by default it has to be enabled via
its configuration file, start the service, and restart Apache (APC,
accelerator, xcache, etc)
3.3Enable Memcache mechanism
Memcache is a high-performance, distributed memory object caching
system. This caching mechanism assists to get better Magento heavy
traffic hits on your database by caching data away from it. Magento
supports Memcache is not enabled by default it has to be enabled via
its configuration file, start the service, and restart Apache.
3.4Implement Redis cache
There are problems while implementing Two Levels Cache Backend (i.e.
to use Memcache together with the database). Redis is an appropriate
alternative to resolve this problem. “Redis is an Open Source, BSD
licensed, advanced key-value store. It is often referred to as a data
structure server since keys can contain strings, hashes, lists, sets and
sorted sets.”
It is measured as one of the superior and most efficient caching
mechanisms for Magento.
7. Given below editions support Redis session and back end caching:
Enterprise Edition (EE) 1.13 and later
Community Edition (CE) 1.9
3.5Implement “Varnish caching”
Varnish is a HTTP accelerator; it plays a role of load balancer. It caches
the created HTML from a web page and serves it to a user sooner than
making a call to the Magento Framework. Hence, it reduces the load
time and decreases the response time extremely well.
3.6Enable MySQL Query Caching
MySQL has its own “query cache”, which is quite supportive to optimize
the MySQL performance. It helps in generating dynamic pages and
content while considerably enhancing the performance.
MySQL stores the query text and its results in its cache and when the
same query is fired, results are made available quickly.
3.7Use a Content Delivery Network (CDN)
CDN helps to reduces server load, by serving the static content like
images, CSS files or Javascript files through a network of servers
intimately located to your customers. A CDN can truly perk up the user
experience on the web site. Some of the free CDN website like
Cloudflare.com
3.8Optimize Performance Through Magento Panel
Keep logging turn off
Magento logging mechanism is turned ON, It can simply be turned off
from the admin panel.
Go to System > Configuration > Advanced > Mage Log > Set Disable and Save
Turn Compilation On
8. This option let you to compile all files of a Magento installation in order
to generate a single include path to enhance performance”.
To enable, Go to “System” > “Tools” > “Compilation” and click on the “Run
Compilation Process” button.
To use this tool, directory includes and the file includes/config.php both
must be writable.
3.9Enable Flat Categories and Products
As each product or category information is stored in multiple tables,
each time a product or category page is requested, a large join query
is prepared to collect all the pieces of information and form a web
page.
Enabling the Flat Catalog generates these pages by using a lone DB
query from a sole DB table. This considerably reduces the bottleneck
performance of loading a product/category page.
System > Configuration >Catalog Panel > Catalogue > Frontend > you will see two
options “Use Flat Catalog Product” and “Use Flat Catalog Category”. Set both to
Yes.
9. 4 Key Contacts:
Ramesh Kumar
CEO & Founder
Skype: Ramesh.RetailOn
Email: Ramesh@RetailOn.net
Whatsapp & Mobile: +91 9739721850
https://www.facebook.com/ramesh.kumar1
4th Floor, 535 Fifth Avenue, New York City, New York 10017, United States
Pragyan Priyadarshani
COO & Cofounder
Skype: Priya.RetailOn
Email: Priya@RetailOn.net
Whatsapp & Mobile: +91 9538374000
https://www.linkedin.com/in/pragyanpriyadarshani
RetailOn, 3rd Floor, 2nd Block, HM Tech Park, Whitefield, Bangalore – 560066