Skip to content
10% off any project with promo code10% off with code

Redis Caching in OpenCart 3.x: Setup and Tuning

Contents
  1. Why Redis rather than file cache
  2. Step 1: install Redis
  3. Step 2: configure redis.conf
  4. Step 3: connect it to OpenCart
  5. Step 4: move sessions to Redis
  6. Monitoring the hit rate
  7. The result
Published
Reading time
~2 min
Views
148
Reader rating
12 reviews
Author
Yevhen Fostenko
Senior Backend & DevOps Engineer
Redis Caching in OpenCart 3.x: Setup and Tuning Article
Need help with your website?
Describe the task on Telegram — I will assess it and suggest where to start. Reply within a day.
Message on Telegram
Free consultation and estimate. I reply quickly.

A slow OpenCart is one of the most common complaints store owners have. One of the most effective ways to speed it up is Redis. Here it is, step by step.

Why Redis rather than file cache

Stock OpenCart uses a file cache in storage/cache/. Redis holds data in RAM, which is 10–100× faster to read than disk. The difference is especially clear on stores with 1,000+ products.

Step 1: install Redis

apt install redis-server php8.3-redis
systemctl enable --now redis-server

Check that Redis is listening on localhost:

redis-cli ping
# PONG

Step 2: configure redis.conf

maxmemory 256mb
maxmemory-policy allkeys-lru
bind 127.0.0.1
requirepass your_strong_password

Step 3: connect it to OpenCart

In config.php, change the storage driver:

define('CACHE_DRIVER', 'redis');
define('CACHE_HOSTNAME', '127.0.0.1');
define('CACHE_PORT', 6379);
define('CACHE_PASSWORD', 'your_strong_password');

Step 4: move sessions to Redis

In php.ini or the PHP-FPM pool configuration:

session.save_handler = redis
session.save_path = "tcp://127.0.0.1:6379?auth=your_strong_password"

Monitoring the hit rate

redis-cli info stats | grep keyspace_hits
redis-cli info stats | grep keyspace_misses

Target: a hit rate above 90%. Below that, raise maxmemory.

The result

Configured properly, Redis brings TTFB down from 800–1500 ms to 50–150 ms, and cuts load on MariaDB by 40–70%.

Want me to set up Redis for your OpenCart? Get a quote.

Tags: redisopencartcachingjetcacheperformance
Need help with your website?
Describe the task on Telegram — I will assess it and suggest where to start. Reply within a day.
Message on Telegram
Free consultation and estimate. I reply quickly.

Related Articles

Optimising OpenCart: From 4 Seconds to 400 ms Article

Optimising OpenCart: From 4 Seconds to 400 ms

A slow OpenCart is one of the most common problems store owners run into. This walkthrough covers the process from analysis to result. Step 1: read the slow…

02/06/2026 189

Reader reviews

5.0
Write a review