# Optimizing OpenCart

> Speed up your OpenCart store with SEO-friendly URLs, compression, browser caching, image optimisation and other tweaks.

Source: https://helpcenter.ruachost.com/apps/opencart/optimizing-opencart/

Optimizing your OpenCart store ensures faster page loads, better customer experience, and improved search engine rankings. On **ruachost.com**, you can apply several performance tweaks to make your OpenCart site run more efficiently.

## Why Optimize OpenCart?

- Faster page load times improve customer satisfaction.
- Optimized sites rank higher in search engines.
- Reduced server resource usage lowers hosting costs.
- Better performance increases conversion rates.

## Key Optimization Steps

### 1. Enable SEO‑Friendly URLs

- In your OpenCart installation directory, rename `.htaccess.txt` to `.htaccess`.
- In the admin dashboard, go to **System → Settings → Server tab**.
- Set **Use SEO URLs** to **Yes**.
- This improves search engine visibility.

### 2. Apache Optimizations

- Add compression and caching rules to `.htaccess`:

### Compression (mod_deflate)

```

 AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript

```

### Browser Caching (mod_expires)

```

 ExpiresActive On
 ExpiresByType image/gif "access plus 1 month"
 ExpiresByType image/jpeg "access plus 1 month"
 ExpiresByType image/png "access plus 1 month"
 ExpiresByType text/css "access plus 1 week"
 ExpiresByType text/javascript "access plus 1 week"
 ExpiresByType application/javascript "access plus 1 week"
 ExpiresDefault "access plus 1 week"

```

### 3. Disable Product Counters

- Product counters slow down category pages if you have many subcategories.
- In the admin dashboard, go to **System → Settings → Option tab**.
- Set **Category Product Count** to **No**.

### 4. Use Caching Systems

- On **ruachost.com**, you can enable:

  - **Memcached** → decreases page load times.
  - **Redis** → improves database query performance.
- Available on **Managed VPS** plans.

### 5. Optimize Images

- Compress images before uploading.
- Use modern formats (WebP) where possible.
- Enable lazy loading for product images.

### 6. Monitor Performance

- Use tools like **Pingdom**, **Google Chrome Developer Tools**, or **YSlow** to measure site speed.
- Identify bottlenecks and apply fixes.

> **Important Notes:**
- Always back up your site before making changes.
- Test optimizations on a staging environment before applying to production.
- Clear OpenCart cache after updates to ensure changes take effect.
