Submit a Ticket
Support Center » Knowledgebase » OpenCart Optimization Steps

OpenCart Optimization Steps

Please consider enabling Memcached on OpenCart for even faster loading speed, before proceeding with the steps below. You can follow this TUTORIAL to do this.

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

1. 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:

- Log in to OpenCart as the administrator.

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

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

- Click the Option tab.

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

- Click the Save icon.

2. Enable Browser Cache.

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

- Navigate to the OpenCart 'root' directory.

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

- 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"


3. Enable Gzip Compression.

- Do the exact same as in Step 2, 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

4. Click Save Changes.

 This answer was helpful  This answer was not helpful