In the previous blog we talked about using Memcached and APC as a caching mechanism to improve the speed of our Magento site. In addition to that we can also make other tweaks to improve the performance of our Magento site.
Enable Magento caching
System ->Cache Management.
This is of course the first step in optimization: Enable all the available caches in the Magento Admin Panel.
Use Magento Compiler module
It’s reported to give you a 25%-50% performance boost: System >Tools >Compilation.
The Magento Compiler module limits the number of directories that PHP has to search through when looking for PHP-files. This decreases the PHP execution-time, which speeds up the Magento application in general. Be warned that you need to be careful when making changes to your Magento system, while the Magento Compiler is enabled. Installation of new plugins and upgrades should only be undertaken when the compiler is (temporarily) disabled.
Disable Magento logging
System ->Configuration ->Advanced ->Developer ->Log Settings (default is disabled).
Within the Magento configuration, you can enable logging under the Developers-tab. Depending on the Magento modules this could lead to more logs needed to be written to the filesystem, slowing down your shop. Because the logging-abilities are only needed to debug something, in daily usage, it's best to disable logging altogether.
Disable Modules not in use
System ->Configuration ->Advanced ->Advanced.
Use Apache mod_expires
In order to ensure that the Magento pages have the correct content expiry in the header, you can add the following block to Magento’s .htaccess file:
ExpiresDefault "access plus 1 month"
Enable Gzip Compression in htaccess
Web pages can be compressed using GZip between the server and the client, reducing the amount of data that needs to be transferred. Although the act of compressing and decompressing adds a performance overhead there is usually a net gain in reducing the amount of traffic especially for large pages. To use GZip compression, enable the mod_deflate module in Apache, and add the following to the vhost for the site:
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4.0 no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary