Magento Optimization

Optimizing your website will keep it running smoothly and loading quickly for your site visitors and customers. These tips will help you keep your Magento install as speedy and error-free as possible.

  • Enable Output Compression. Turning on the mod_deflate module will enable text, javascript, and css compression. In your Magento .htaccess file, look for the part which starts with <IfModule mod_deflate.c> and ends with </IfModule>. Remove the "#" from the beginnings of all the lines with commands in them, like this:
<IfModule mod_deflate.c>

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

# Insert filter on all content
SetOutputFilter DEFLATE
# Insert filter on selected content types only
AddOutputFilterByType DEFLATE text/html text/plain text/xml
text/css text/javascript

# 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[678] 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

</IfModule>

 

  • Enable Expires Headers. This will make some HTTP requests cacheable. This will reduce CPU load and bandwidth consumption. You will need to edit the .htaccess file, starting from the <IfModule mod_expires.c> and ending with </IfModule>, and edit it to match this:

 

<IfModule mod_expires.c>

############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires

ExpiresActive On
ExpiresDefault "access plus 1 year"

</IfModule>

 

  • Merge CSS and JS. This will further decrease the HTTP requests to your server. 
  1. Log into the Magento administration area.
  2. Select "System", then "Configuration", then "Developer".
  3. Change "Merge JavaScript Files" to "yes".
  4. Change "Merge CSS Files" to "yes".
  5. Clear the Magento cache.
  • Enable Flat Catalog. Magento uses long SQL queries and frequent reads. Flat Catalog merges data into one table and improves performance.
  1. Log into the Magento administration area.
  2. Select "System", then "Configuration", then "Catalog".
  3. Under "Frontend" change "Use Flat Catalog Category" to "Yes".
  4. Under "Frontend", change "Use Flat Catalog Product" to "Yes".
  5. Clear the Magento cache.
  • Database Logs. Magento database logs can become very large quite quickly. You can enable log cleaning this way:
  1. Log into the Magento administration area.
  2. Find "Advanced" on the left side and click "System".
  3. Under the heading "Log Cleaning", change "Enable Log Cleaning" to "Yes" and set the Save Log for 14 days.
  4. Select "Save Config".
  • log.php Utility. Magento has a shell utility which you can configure with Cron or run manually.
    For manual configuration, log into your account with SSH and cd to the Magento directory. Enter this:
php -f shell/log.php clean

 

  • log.php Cron.
  1. Log into cPanel.
  2. Click "Cron Jobs".
  • Database Cleaning with phpMyAdmin. You will want to complete this task regularly. The cron job makes automating it easy.
  1. Log into cPanel.
  2. Click phpMyAdmin.
  3. Select the database your Magento installation uses.
  4. Select the following tables
    log_customer
    log_quote
    log_summary
    log_summary_type
    log_url
    log_url_info
    log_visitor
    log_visitor_infor
    log_visitor_online
  5. Select the dropdown box "With Selected." and choose "Empty".
  6. Click "yes" at the confirmation screen.
  • 24 Users Found This Useful
Was this answer helpful?

Related Articles

Is it a problem if I'm not in the US?

Not at all! In fact, we already have customers in countries all over the world.

I uploaded my page but it's not working!

Make sure that you are uploading to the public_html or www folder.  Only the files placed...

What is an error 404 page?

Error 404 indicates that you are requesting a file or a directory that does not exist on the...

Can I run scripts like Wordpress, Joomla, or phpBB on my site?

Absolutely! We make it extremely easy to install over 250 different scripts via the Softaculous...

Can I upgrade my plan or features later?

Upgrades/Addons are available to purchase at any time through your Client Area dashboard. Once...