The display of images from other websites can slow down your whole web page. Indeed, we have to resolve the distant address and then start a new download process from this distant server.
We definitely appreciate how easily we can make money with Magento through PayPal, but let's have a look at PayPal's logo on our website. PayPal's logo is a 160 x 60 GIF image and its size is only 5.3 KB. Nevertheless, this tiny image comes from the PayPal website and it's amazingly slow to get it displayed on our website.
In order to remove it, go to System | Configuration | Payment Methods | PayPal All-in-One Payment Solutions and then hit the Configure button. In this page, go to Basic Settings - PayPal Payments Advanced | Advanced Settings | Frontend Experience Settings and select No Logo.
Save your configuration in the top-right corner. The following table shows the data for the PayPal logo:
Type |
Requests |
Load time |
Size |
---|---|---|---|
With the PayPal logo |
37 |
1.72 seconds |
719 KB |
Without the PayPal logo |
35 |
1.12 seconds |
713.4 KB |
More than half a second less on the loading of the home page with this simple setting. Of course, we encourage you to display PayPal's logo on your website; just host it locally.
The PayPal logo is hosted on the PayPal website. According to the Pingdom Tools website (http://tools.pingdom.com), the statistics of this image are as follows:
Source: http://www.paypalobjects.com
Weight: 5.3 KB
Size: 150 x 160 pixels
Type: GIF
Total time to retrieve: 1.70 seconds
We will not be able to achieve any less than 1.70 seconds on the loading of the home page because all images are loaded in parallel. The reason this image takes so long to be retrieved from PayPal's servers is because our server has to resolve the real address of the image, and SSL is activated for all communications with PayPal, even for images.
Downloading images from the distant server can improve your performance if the distant server is specifically designed to achieve this task.
A content delivery network, also known as CDN, is a group of servers scattered all over the world inside data centers in order to deliver static content such as images and style files, in an optimized way. Indeed, your users can have a server belonging to the CDN that is closer than your Magento server, and the CDN servers are optimized for delivering static contents.
Let's have a look at our website if we turn on all the options we have previously studied:
Set Merge CSS Files to Yes
Set Merge JavaScript Files to Yes
Set Log Settings Enabled to No
Set Compilation Enabled to Yes
Set Index up to date to Yes
Set PayPal Logo to No
The following table shows you how much we have improved Magento's performances so far:
Type |
Requests |
Load time |
Size |
---|---|---|---|
CSS (before) |
3 |
107 milliseconds |
100.6 KB |
CSS (after) |
1 |
35 milliseconds |
110.6 KB |
JS (before) |
13 |
742 milliseconds |
363.4 KB |
JS (after) |
1 |
62 milliseconds |
360 KB |
Overall (before) |
49 |
2.58 seconds |
724.3 KB |
Overall (after) |
35 |
1.12 seconds |
713.4 KB |
With these six very simple settings, we improve our performance by more than one second.
Nevertheless, 1.12 seconds is still high for an e-commerce website. With the following settings, we will go deeper in order to break the 1-second wall. To do that huge task, we will compress the size of our pages by 80 percent, set up and administrate caching systems, and optimize the way PHP, Apache, and MySQL work.
With the previous settings, we have improved the performance of our test subject by almost 1 second with six simple settings. It's time to go under the surface of Magento and the different servers that support it. As previously done, for each new task we will turn off or reverse the previous settings in order to clearly identify what the pros of each one are. However, all settings seen before are still enabled.
As a reminder, the following table shows our test subjects' performances:
Type |
Requests |
Load time |
Size |
---|---|---|---|
CSS |
1 |
35 milliseconds |
110.6 KB |
JS |
1 |
62 milliseconds |
360 KB |
Overall |
35 |
1.12 seconds |
713.4 KB |
We will show you how to parameterize your servers in order to get some speed. We advise you to rename the local.xml.sample
file inside the /errors/
directory of Magento to local.xml
. With this action, you will be able to see errors on your Magento frontend.
We assume that most of the readers are on a Linux-based system. The following is the configuration for this book:
2x Ubuntu Server 12.04.1 (32 bit), 2 GB RAM, and 1 Core at 2.7 GHz
MySQL 14.14
Apache 2.2.22
PHP 5.3.10-1