Skip to content

Speeding up WordPress on a VPS with caching (Redis + FastCGI)

By Onehost Team1 min read

WordPress can be fast — the secret is caching. On a VPS you control the full stack, so you can add the two caching layers that make the biggest difference.

1. FastCGI page cache (Nginx)

This caches fully-rendered pages, so most visitors are served static HTML without touching PHP or the database at all — a massive speed boost for anonymous traffic.

fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=WP:100m inactive=60m;
# then enable fastcgi_cache in your PHP location block

2. Redis object cache

Redis caches database query results in memory, speeding up logged-in users and dynamic pages:

sudo apt install redis-server php-redis -y

Then install a Redis object-cache plugin in WordPress and enable it.

3. Other wins

  • Use PHP 8.x with OPcache enabled.
  • Serve images in modern formats and enable browser caching.
  • Put a CDN in front for global visitors.

On a Onehost VPS with full root access, you can run all of these caching layers and make WordPress noticeably faster.

Put it into practice

Let our engineers set up, patch and monitor your web server.

Managed Linux VPS