> ## Documentation Index
> Fetch the complete documentation index at: https://kb.mochahost.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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](https://clientarea.mochahost.com/knowledgebase/854) 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.

![](https://tutorials.my-virtual-panel.com/opencart_optimization/1_OpenCart.png)

2. Click the  **OpenCart > Settings** icon, and then click **Settings**.

![](https://tutorials.my-virtual-panel.com/opencart_optimization/2_OpenCart.png)

3. Select your store, and then click the **Edit** icon.

![](https://tutorials.my-virtual-panel.com/opencart_optimization/3_OpenCart.png)

4. Click the **Option** tab. ![](https://tutorials.my-virtual-panel.com/opencart_optimization/4_OpenCart.png)

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

![](https://tutorials.my-virtual-panel.com/opencart_optimization/5_OpenCart.png)

6. Click the **Save** icon.

![](https://tutorials.my-virtual-panel.com/opencart_optimization/6_OpenCart.png)

### Enable Browser Cache.

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

![](https://tutorials.my-virtual-panel.com/opencart_optimization/7_OpenCart.png)

2. Navigate to the **OpenCart 'root' directory**.

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

![](https://tutorials.my-virtual-panel.com/opencart_optimization/8_OpenCart.png)

![](https://tutorials.my-virtual-panel.com/opencart_optimization/9_OpenCart.png)

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

\`## EXPIRES CACHING ##

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"

## EXPIRES CACHING ##\`

![](https://tutorials.my-virtual-panel.com/opencart_optimization/10_OpenCart.png)

### 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\`

2. Click Save Changes.

![](https://tutorials.my-virtual-panel.com/opencart_optimization/11_OpenCart.png)
