The Layer Nobody Sees in WordPress: The Web Server and Its Role as a Proxy

Automated English translation of the original Spanish article. Code examples keep their original identifiers.

In a previous article, we talked about Redis and Memcached: those silent heroes that prevent the database from collapsing under heavy load. But even with them properly configured, your server can still crash.

Why? Because there is another critical layer that most people overlook: the way requests enter your site. That front door decides, before anything else, whether your WordPress survives or collapses.

The Problem Almost Nobody Looks At

When someone visits your WordPress site, they don’t talk directly to PHP or MySQL. First, they must go through an “entryway.” And that entryway can make all the difference between a site that responds quickly and one that crashes.

Without proper control at that entrance, traffic flow becomes destructive:

  1. Every request hits the backend without any filtering.
  2. PHP becomes overwhelmed processing things it could have avoided.
  3. The database receives unnecessary queries.
  4. The server eventually collapses.

When you have a well-configured entry layer, everything changes:

  1. Many requests are resolved directly at the proxy, without touching PHP.
  2. Others are served from cache.
  3. Malicious or suspicious traffic is blocked before entering.
  4. The backend (PHP + database) only works when truly necessary.

Reverse Proxy: The First Line of Defense

A reverse proxy isn’t just “another component” in the stack. It is literally the first point of contact between the internet and your application. Its primary responsibilities include:

  • TLS termination: Handles the HTTPS handshake so PHP doesn’t have to.
  • HTTP caching: Serves pre-generated responses without invoking the backend.
  • Load balancing: Distributes requests across multiple instances of your application.
  • Rate limiting: Restricts the number of requests per IP or specific path.
  • Traffic filtering: Blocks bots, brute force attacks, and suspicious patterns.

Every request that doesn’t reach WordPress is a small victory. Not because WordPress is slow, but because any processing you can avoid is capacity saved for when you truly need it.

Edge Caching vs. Application Caching

It is important not to confuse the different caching layers:

  • Application caching (Redis / Memcached): Operates near the backend and prevents repeated database queries. The request still reaches your server.
  • Server caching (Nginx, LiteSpeed): Operates at the web server level and can respond to the request without executing PHP at all.
  • Edge caching (CDN): Operates outside your infrastructure on globally distributed servers. The request never reaches your server.

The further away from the origin a request is resolved, the better. The combination of all three layers is what truly allows a WordPress site to scale: Redis protects the database, the web server protects PHP, and the CDN protects the entire server.

Nginx: Power and Total Control

Nginx has become the standard for this role, and that’s no coincidence. Its event-driven, non-blocking I/O architecture allows it to handle thousands of concurrent connections with very few resources—something traditional servers like Apache (in its classic configuration) often struggle to match under heavy load.

What Nginx gives you is a powerful set of tools: proxy_pass to route requests, fastcgi_cache to cache PHP-FPM responses, and limit_req_zone to apply granular rate limiting.

A practical example:

http {
    limit_req_zone $binary_remote_addr zone=wp_login:10m rate=5r/m;

    server {
        location = /wp-login.php {
            limit_req zone=wp_login burst=3 nodelay;
            fastcgi_pass php_backend;
        }
    }
}

This snippet limits login attempts to 5 per minute per IP (with a burst of 3), and it does so before the request even reaches WordPress.

Important: In WordPress environments, a large part of real performance with Nginx comes not just from the proxy itself, but from how it pairs with PHP-FPM (workers, pm.max_children, buffers, etc.). Nginx can prevent unnecessary requests from reaching PHP, but if PHP-FPM isn’t properly sized, it will still become the bottleneck.

The tradeoff: Nginx does nothing useful out of the box. Every optimization requires manual configuration. A poor configuration can turn it into a problem rather than a solution.

LiteSpeed: Integrated Performance, Less Friction

LiteSpeed follows a different philosophy: instead of giving you loose parts, it delivers a system that is already optimized for WordPress. Its main advantages are:

  • LSCache works at the web server level (not just as a plugin) and can cache content before PHP even starts running.
  • Native support for HTTP/3 and QUIC, reducing latency over unstable connections.
  • Specific optimizations for PHP-LiteSpeed SAPI, which in some cases outperforms PHP-FPM.
  • Direct integration with its WordPress plugin for highly granular cache invalidation (by post, category, page, etc.).

Such tight integration has its downside: when something doesn’t work or scale as expected, you have less room for fine-tuning than with a manual Nginx configuration. You gain rapid deployment and solid performance from day one, but you sacrifice some granular control under the hood.

Additionally, the high-performance tier requires a paid license, which must be factored into larger projects.

It’s Not a War: It’s an Architectural Decision

Benchmarks pitting Nginx against LiteSpeed often miss the point. The right question isn’t “which one is faster?”, but “which one fits my project and team better?”.

Nginx is the best choice when:

  • You need complete control over proxy behavior.
  • You are building a more complex architecture (multiple backends, conditional routing, microservices).
  • You have the technical capacity to maintain detailed configurations and troubleshoot issues.

LiteSpeed is the best choice when:

  • You work primarily with WordPress and want quick results.
  • You prioritize operational simplicity over maximum flexibility.
  • Your stack is fairly standard and doesn’t require heavy customization.

How This Layer Fits with Redis and Memcached

If we look at the full stack, each layer protects the next:

graph TD
    A[Cliente] --> B[Servidor Web / Reverse Proxy]
    B -->|Filtra, cachea, protege| C[WordPress PHP]

    subgraph Capa_Optimización
        C -->|Consulta objetos cacheados| D[Cache de Objetos / Redis]
        D -->|Cache miss: consulta DB| E[(Base de Datos)]
    end

    style A fill:#1a1a1a,stroke:#00d4ff,stroke-width:2px,color:#fff
    style B fill:#1a1a1a,stroke:#bb86fc,stroke-width:2px,color:#fff
    style C fill:#1a1a1a,stroke:#cf6679,stroke-width:2px,color:#fff
    style D fill:#1a1a1a,stroke:#03dac6,stroke-width:2px,color:#fff
    style E fill:#1a1a1a,stroke:#ffde03,stroke-width:2px,color:#fff
    style Capa_Optimización fill:#2d2d2d,stroke:#666,color:#fff
    

If Redis keeps the database from collapsing, the reverse proxy keeps the server from ever needing to reach Redis in the first place.

They are not mutually exclusive; they are complementary. And the order matters: if you optimize from the inside out without securing the entry layer first, you will always be leaving performance on the table.

The Most Common Mistake

Many administrators optimize WordPress “from the inside”: they install caching plugins, tune queries, tweak PHP… but completely forget about the entry layer. It’s like trying to fix your car engine in the middle of a highway.

When This Layer Begins to Scale

With moderate traffic, a single, properly configured Nginx instance is usually enough. As volume grows, this layer naturally evolves into:

  • CDN with edge caching: Content is served from nodes close to the user.
  • Dedicated load balancers (HAProxy, AWS ALB, GCP Load Balancer) with automated health checks.
  • API Gateways to centrally manage authentication, rate limiting, and logging.
  • Kubernetes Ingress when the application is containerized.

In these scenarios, more advanced patterns emerge, such as circuit breaking, retry policies, or canary deployments. But the core idea remains the same: the earlier you intercept a problem, the less damage it causes.

Ready for Battle?

Systems don’t collapse solely from a lack of resources. They collapse because their architecture isn’t designed to absorb load intelligently and progressively.

Redis and Memcached protect the database.

But the web server and reverse proxy are the ones that decide if the battle even begins.

In many cases, they win it before it even starts.