Magento is a very popular, robust and enterprise grade open source e-commerce framework built in PHP. On one side these are the positive aspects of this application but on the other side this mammoth is reported to have slow performance. Page load time is high which adversely affects customers and SEO efforts. Below are some useful steps that will improve the performance of Magento Community Edition.
KeepAlive On KeepAliveTimeout Default 5 seconds MaxKeepAliveRequests Default 100
Apache KeepAlive settings provide long-lived HTTP sessions which allow multiple requests to be sent over the same TCP connection. In some cases this has been shown to result in an almost 50% speedup in latency times for HTML documents with many images.
This module controls the setting of the Expires HTTP header and the max-age directive of the Cache-Control HTTP header in server responses. The expiration date can set to be relative to either the time the source file was last modified, or to the time of the client access.
These HTTP headers are an instruction to the client about the document's validity and persistence. If cached, the document may be fetched from the cache rather than from the source until this time has passed. After that, the cache copy is considered "expired" and invalid, and a new copy must be obtained from the source
For this you can do below settings in your .htaccess file.
ExpiresActive On ExpiresByType text/css "access plus 2 day" ExpiresByType image/gif "access plus 2 day" ExpiresByType image/jpg "access plus 2 day" ExpiresByType image/png "access plus 2 day"
Here you can set max age to day, month or year.
APC engine cache the compiled bytecode of PHP scripts to avoid the overhead of parsing and compiling source code on each request. And it is improving performance around 50%.
Steps to install APC on Linux:
apc.enabled=1 apc.shm_size=512M apc.num_files_hint=10000 apc.user_entries_hint=10000 apc.max_file_size=5M apc.stat=0 apc.optimization=0 apc.shm_segments=1 apc.enable_cli=1 apc.cache_by_default=1 apc.include_once_override=1
Go to your Magento installation
Open local.xml file /app/etc/local.xml and add below lines in between <global>...</global>
tags.
<cache> <backend>apc</backend> <slow_backend>File</slow_backend> <prefix>Myproject_</prefix> </cache>