How to Enable Redis or Memcached for Faster WordPress
Website speed is one of the most critical factors for user experience, SEO ranking, and conversion rates. If your WordPress site feels sluggish, enabling server-side caching with Redis or Memcached can drastically improve performance.
In this guide, we’ll walk you through how to enable Redis or Memcached for your WordPress site — especially when hosted on Sternhost VPS, which fully supports both caching technologies.
What Are Redis and Memcached?
Both Redis and Memcached are in-memory caching systems that temporarily store frequently accessed data, reducing the load on your database and improving page load speeds.
Feature | Redis | Memcached |
---|---|---|
Data Type Support | Strings, Lists, Hashes, Sets | Strings only |
Persistence | Yes | No |
Performance | Slightly slower but more powerful | Extremely fast but simple |
Use Case | Complex apps, sessions, and caching | Simple page and query caching |
For most WordPress users, either Redis or Memcached can dramatically speed up database-driven pages.
Step 1: Install Redis or Memcached on Sternhost VPS
If you’re using Sternhost VPS, installing Redis or Memcached is simple. Connect via SSH and run the following commands depending on your choice:
For Redis:
For Memcached:
Confirm they are running:
Step 2: Install PHP Extensions
Your WordPress needs PHP support for the chosen caching system.
For Redis:
For Memcached:
Restart your web server:
Step 3: Configure WordPress to Use Redis or Memcached
Option 1: Using a Plugin (Recommended)
You can use one of the following plugins:
-
For Redis:
-
Plugin: Redis Object Cache
-
Install via WordPress → Plugins → Add New → Search “Redis Object Cache”
-
Activate and click Enable Object Cache
-
-
For Memcached:
-
Plugin: W3 Total Cache or LiteSpeed Cache (if on LiteSpeed)
-
Go to Performance → General Settings
-
Enable Memcached under Object Cache or Database Cache
-
Option 2: Manual Configuration (Advanced)
For Redis, edit your wp-config.php and add:
For Memcached:
Then restart your web server.
Step 4: Verify the Cache is Working
Once enabled, test your cache with these commands:
For Redis:
For Memcached:
Alternatively, check plugin dashboards for cache hit/miss ratios.
Step 5: Benchmark Your Site
You can verify performance improvements using tools like:
You’ll likely notice faster TTFB (Time to First Byte) and reduced server response time after enabling caching.
Benefits of Using Redis or Memcached on Sternhost VPS
-
🚀 Faster Page Loads: Reduces database queries.
-
💾 Lower Resource Usage: Frees up CPU and RAM for other tasks.
-
🔒 Better Scalability: Handles more traffic efficiently.
-
🔁 Improved Uptime: Reduces server stress during traffic spikes.
With Sternhost’s high-performance VPS, Redis and Memcached can operate at peak efficiency — giving your WordPress site a significant performance edge.
Redis and Memcached are powerful caching solutions that can make your WordPress website load in milliseconds instead of seconds. Whether you prefer Redis’s advanced capabilities or Memcached’s simplicity, both can transform your website’s speed when combined with Sternhost’s VPS hosting.
👉 Start optimizing your WordPress performance today with Sternhost VPS Hosting — built for speed, reliability, and scalability.