OpenCart Optimization Steps

Please consider enabling Memcached (Available for our Mocha and WordPress advanced packages) on OpenCart for even faster loading speed, before proceeding with the steps below. You can follow this TUTORIAL to do this.

Optimize and speed up your OpenCart application

In order to optimize and speed up your OpenCart application, please follow the steps below:

Disable product counters

OpenCart counts the number of products in each subcategory. If your store has a lot of subcategories, however, this feature can negatively affect performance.

To disable product counters, follow these steps:

  1. Log in to OpenCart as the administrator.

  1. Click the  OpenCart > Settings icon, and then click Settings.

  1. Select your store, and then click the Edit icon.

  1. Click the Option tab.

  2. Under Products, for the Category Product Count option, click No.

  1. Click the Save icon.

Enable Browser Cache.

  1. Click on the File Manager under FILES in your Cpanel.

  1. Navigate to the OpenCart 'root' directory.

  2. Make sure to click on the Settings button and enable Show Hidden Files (dotfiles).

  1. Edit the .htaccess.txt file and add (copy/paste) the following at the end.


ExpiresActive On
ExpiresByType image/jpg "access plus 1 week"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType image/gif "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType text/css "access plus 1 week"
ExpiresByType application/pdf "access plus 1 week"
ExpiresByType text/x-javascript "access plus 1 week"
ExpiresByType application/x-shockwave-flash "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 week"
ExpiresDefault "access plus 1 week"


Enable Gzip Compression.

  1. Do the exact same as in Enable Browser Cache section, by copy/pasting the content below at the end of the .htaccess.txt file:

`# compress text, HTML, JavaScript, CSS, and XML
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

remove browser bugs

BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent`

  1. Click Save Changes.