Skip to content

How to manage Nginx caching and rewrites in Kiravo

To enable Nginx FastCGI cache on your Kiravo website, open the website’s Advanced dropdown, choose Developer tools, then Nginx in the sidebar. Pick the domain to configure, switch on FastCGI cache, exclude any paths that shouldn’t be cached (like /wp-admin), and you’re done. Pages get noticeably faster immediately.

This guide also covers the other Nginx settings on the same page — cache exclusions, URL rewrites, purging the cache, and (under Optimisation) toggling Opcode caching for PHP.

  1. From your website’s dashboard, click Advanced in the top menu bar.
  2. Choose Developer tools.
  3. In the sidebar on the left, click Nginx.
  4. At the top of the page, select the domain you want to configure. (Settings are per-domain.)

FastCGI cache stores the rendered HTML of each page server-side, so subsequent requests for the same URL are served from cache without re-executing PHP. The performance difference is dramatic — uncached WordPress pages often run 200–500ms; cached ones run in 10–30ms.

To enable it, toggle FastCGI cache on.

That’s the headline change. The next sections let you tune what gets cached and when to clear it.

Some URLs should never be cached — they’re personalised, dynamic, or change every second. Caching them would serve stale or wrong content to the wrong user.

Click Add in the Cache exclusion section, then enter the path to exclude. Common WordPress exclusions:

  • /wp-admin — the WordPress admin area; users see each other’s sessions otherwise.
  • /wp-login.php — the login page.
  • /cart, /checkout, /my-account — for WooCommerce or any e-commerce store, these are user-specific.

Each exclusion is a path pattern. Anything matching the pattern bypasses the cache and is rendered fresh.

Click Add rewrite to create a rewrite rule. Each rule has:

  • Source path — the URL pattern visitors hit.
  • Destination path — what Nginx serves under the hood.

Common use cases:

  • WordPress pretty permalinks/sample-post/ rewrites to /index.php?p=42. WordPress installations need a rewrite of /index.php for permalinks to work — Kiravo sets this up automatically when you install WordPress through the panel.
  • Single-page apps/anything-not-matching-a-real-file/index.html. Lets React, Vue, etc. SPAs handle their own routing.

This is the same kind of work .htaccess does on Apache. On Nginx it’s done here, in the panel.

After publishing content changes, your cached pages still hold the old version until they naturally expire. To clear everything immediately, click Purge in the Purge cache section.

The cache empties; the next visit to each page rebuilds the cached version from the new content.

Typical times to purge:

  • After publishing a new blog post (so the homepage shows it).
  • After making sitewide CSS or JS changes.
  • After updating WordPress, plugins, or themes that change page output.
  • After fixing content that was wrong.

Toggle Opcode caching (under Optimisation)

Section titled “Toggle Opcode caching (under Optimisation)”

While not in the Nginx section itself, Opcode caching is the other major performance toggle on a Kiravo site. Find it under Advanced → Optimisation.

Opcode caching caches the compiled form of your PHP scripts, so PHP doesn’t have to parse and compile them on every request. The effect is similar in spirit to FastCGI cache but at the PHP level — uncached requests still execute the PHP code, just much faster.

Leave it on. There’s essentially no downside.

What to enable for a typical WordPress site

Section titled “What to enable for a typical WordPress site”

For a typical WordPress site:

  1. FastCGI cache: on, with /wp-admin, /wp-login.php, and your e-commerce checkout paths excluded.
  2. Opcode caching: on (Advanced → Optimisation).
  3. Rewrites: leave defaults — WordPress’s permalink rewrite is set up automatically.
  4. Purge after every content change that should show up immediately.

These four together give you most of the performance Kiravo’s stack is capable of, with effectively zero ongoing maintenance.