Technology

LiteSpeed or Nginx for WordPress Hosting?

If your site slowed down after migrating from Apache or .htaccess stopped working, this guide helps you decide whether LiteSpeed or Nginx is better suited to your actual workload.

Technology

You've moved your site from Apache shared hosting to a new server, everything is up, but TTFB is stuck at 800 milliseconds and WordPress pages load slower than before. Or the opposite: you're on Nginx and your old .htaccess file, which you used to manage redirects and security rules, is being silently ignored. These two symptoms are exactly where the decision between LiteSpeed and Nginx becomes meaningful.

First of all, a simple distinction that many people confuse: LiteSpeed is two different things. One is the Enterprise version that is installed directly on the server and replaces Apache, and the other is LSWS with the lsapi module that runs PHP through lsphp. If you're on shared hosting, you're probably just a consumer of it; if you have a dedicated server, you need to decide for yourself which one to bring up.

What LiteSpeed's built-in cache actually does

The biggest practical difference is LSCache. This cache runs at the web server level itself, not in PHP. That means when a visitor requests a page that has already been cached, the request never reaches PHP-FPM and MySQL. On a typical WordPress with the WooCommerce plugin, this single layer can bring TTFB from 700 milliseconds down to under 100 milliseconds, provided the cache is configured correctly.

The point that surprises many people in practice: LSCache only works when the litespeed-cache plugin is installed and active and the server is actually LiteSpeed. If you're on Nginx and install this plugin, you won't see any error, but no caching will happen either. The sign is that in the plugin's cache tab, the Hit Rate number stays at zero while traffic is coming in.

Correct cache configuration in LiteSpeed

In the plugin settings, under the Cache section, take the following options seriously:

  • Cache Logged-in Users: for e-commerce sites this should usually stay off, otherwise users' shopping carts get mixed up.
  • Cache Mobile: if you have a responsive theme and no separate mobile version, turning it on just wastes memory.
  • Default Public Cache TTL: a value of 3600 seconds is a reasonable starting point; for a high-traffic news site you can lower it.

At the server level, if you have root access, in the file /usr/local/lsws/conf/httpd_config.conf you can move the cacheStoragePath value to a separate NVMe disk. This makes a noticeable difference in cache response time when your site has more than 50,000 daily visits.

htaccess compatibility; the point where Nginx falls short

Nginx does not read the .htaccess file. This is a design limitation, not a bug. If your WordPress site was on Apache and you wrote 301 redirects, RewriteRule rules, or IP restrictions in htaccess, after migrating to Nginx they all stop working. The sign is clear too: old links return 404, or a page that should only be accessible to a specific IP is open to everyone.

The standard solution is to manually translate these rules into a location block in Nginx. For example, this Apache line:

RewriteRule ^blog/(.*)$ /articles/$1 [R=301,L]

In Nginx becomes:

location ~ ^/blog/(.*)$ {
    return 301 /articles/$1;
}

Here's where people make a mistake: many think it's enough to keep the htaccess file next to the site and Nginx will figure it out on its own. It won't. The result is that three months later, when Google re-crawls the old redirects, organic traffic drops and no one knows why.

LiteSpeed wins in this area because it reads htaccess. If your site is full of htaccess rules and you don't want to migrate them all manually, LiteSpeed is the more logical choice. If you designed on Nginx from the start and keep your rules in the server config, this advantage is worthless to you.

Under what workload the difference is actually visible

On low-traffic sites, the difference between LiteSpeed and Nginx is at the noise level. Both respond under 200 milliseconds and the user doesn't feel anything. The difference starts when request concurrency goes up.

ScenarioLiteSpeedNginx
WordPress site with page cacheBuilt-in cache, no extra layer neededRequires FastCGI Cache or Redis
htaccess compatibilityFullNone
Memory usage under high loadLower, because cache is in the serverDepends on worker configuration
Flexibility in reverse proxyMore limitedVery high
HTTP/3 supportYesYes

Under heavy loads, for example when you have 2000 concurrent requests, Nginx usually remains more stable due to its event-driven architecture and lower memory usage. But if page caching is set up correctly, most of those 2000 requests never reach PHP and the practical difference disappears. To better understand why server architecture affects response speed, see the HTTP/3 and multiplexing guide.

A cost that is rarely mentioned

LiteSpeed is not free. The Enterprise version has a license, and if you're installing it on your own physical server, you need to factor in its cost. Nginx is free, and this makes it the default choice for projects with limited budgets. If your site has 500 visits a day, paying for a LiteSpeed license isn't economically justified; the same Nginx with a simple cache is enough.

Which one should I choose

If you have a WordPress site, have heavy htaccess, and don't want to spend time translating rules, choose LiteSpeed. If you have full control over your own infrastructure, use a reverse proxy, or bring several different services behind one web server, Nginx is the more correct choice. I personally prefer LiteSpeed for WordPress projects that the client manages themselves, because I rarely see anyone who actually takes the time to write the Nginx config correctly.

If you're just choosing a server and aren't sure which architecture suits your workload, a cloud server lets you test without a long-term commitment and then decide. To check the network and DNS path before migrating, the network tools will get you going too.

Frequently asked questions

Can LiteSpeed replace Nginx in a reverse proxy?

To some extent yes, but not with the same flexibility. LiteSpeed supports reverse proxy but for complex scenarios like advanced load balancing or routing based on specific headers, Nginx is the more mature option. If your architecture has multiple layers, they usually keep Nginx at the edge and use LiteSpeed only for serving WordPress.

Why didn't my site get faster after installing the LiteSpeed Cache plugin?

Because your server isn't LiteSpeed. The plugin only builds cache when the web server supports LSCache. If you're on Apache or Nginx, the plugin has no effect and you either need to change the server or use another caching layer like FastCGI Cache.

Does Nginx support the htaccess file?

No, and there is no official module for this either. You need to manually migrate the rules to location and rewrite blocks in the config file. This is done once, but if you have a lot of htaccess rules, it takes several hours.

Which option is better for an e-commerce site?

For WooCommerce, LiteSpeed with its built-in cache usually gives a better result because you can cache product and category pages without breaking users' shopping carts. Just remember to keep caching for logged-in users off. If your store has high traffic and you use a CDN, Nginx with the right configuration gives the same result.

ServerNet Support

ServerNet engineering & editorial team — specialists in infrastructure, networking and web hosting.

Iran VPS
Share:

Comments 0

No comments yet — be the first!

Leave a comment

Related service

Iran VPS

NVMe in the heart of Tehran — for sites and apps serving Iranian users: the fastest local ping, discounted domestic traffic and instant delivery.