Skip to main content

How Caching Works at Seravo

A guide to Seravo's multi-layered caching architecture (nginx, Redis, OPcache). Learn how server-level HTTP caching works, how to inspect the X-Proxy-Cache header, and how to purge or bypass the cache.

Caching temporarily stores site responses and computed results so that subsequent page loads can be served immediately without heavy PHP and database processing. In Seravo's hosting environment, caching is built directly into the server stack across multiple layers and does not require third-party page-caching plugins.

Prerequisites and Important Notes

  • No separate page-caching plugins are needed: Seravo handles full-page HTTP caching (nginx) and object caching (Redis) directly at the server level, so separate page-caching plugins are unnecessary. If you use a performance optimization plugin (such as WP Rocket or Autoptimize) for other optimizations—such as minifying or combining CSS and JavaScript assets—make sure its built-in page caching feature is disabled so it does not conflict with the server's HTTP cache. For more details, see Unnecessary, Prohibited, and Malicious Plugins at Seravo.

  • Permissions for purging the cache: Purging the cache from the WordPress admin bar requires logging into the WordPress dashboard; purging via the command line requires an SSH connection.

Seravo's Caching Architecture and Default Logic

Seravo's server environment uses four complementary caching layers:

  1. nginx HTTP cache (page cache): The most critical layer for site speed and handling traffic spikes. It stores rendered HTML pages and serves them directly from memory without invoking PHP.

  2. Redis (object cache): Stores the results of frequent database queries and WordPress objects in memory, significantly speeding up logged-in user sessions and online store operations.

  3. PHP OPcache: Stores precompiled PHP bytecode in memory so PHP scripts do not need to be parsed on every page load.

  4. MariaDB database cache: Optimizes database query memory usage at the server level.

Default nginx HTTP Cache Lifetimes

Unless WordPress, a plugin, or a custom nginx configuration overrides the behavior with custom Cache-Control headers, Seravo's nginx follows these default rules:

  • Successful requests (HTTP 200 / 206): Cached for 15 minutes by default.

  • Inactive resources: If a cached page or asset is not requested for 60 minutes, it is automatically purged from the server cache to conserve resources.

  • Developer control: Default lifetimes can be customized using HTTP headers sent from WordPress or nginx configuration files. For detailed instructions, see Limiting Cache and Setting Headers.

When Is the Server HTTP Cache Bypassed Automatically?

To ensure dynamic and user-specific views work reliably, nginx automatically bypasses the page cache in the following scenarios:

  • The visitor is logged into WordPress (the browser has a wordpress_logged_in_* cookie).

  • The visitor has an active shopping cart or session cookie (such as WooCommerce's woocommerce_items_in_cart or woocommerce_cart_hash).

  • The request is a POST request or targets admin endpoints (/wp-admin/, wp-login.php, admin-ajax.php).

  • The application returns a Set-Cookie header or a Cache-Control: no-cache / private header in its response.

Checking Cache Status (X-Proxy-Cache)

You can inspect the cache status of any page via the X-Proxy-Cache HTTP response header using your browser's developer tools (Network tab) or from the command line with curl:

curl -I https://example.com

X-Proxy-Cache Value

Meaning

HIT

The page was served directly from nginx's HTTP cache (fastest possible response).

MISS

The page was not yet in the cache; it was generated by PHP and stored in the cache for subsequent visitors.

BYPASS

The cache was intentionally bypassed (for example, due to a login cookie, shopping cart cookie, or no-cache header).

EXPIRED

The cached version had expired, and a fresh version was fetched from PHP.

Best Practices for Developers

Choosing the right caching strategy is essential for both site performance and server stability:

  • Keep full-page HTTP caching active: PHP execution consumes significant server resources. Without HTTP caching, sudden traffic spikes or bot traffic can exhaust all available PHP workers and slow down or crash the site. On highly dynamic pages, you can use fragment caching, where personalized elements (such as a shopping cart widget) are loaded separately while the rest of the page is served directly from the cache.

  • A short cache lifetime is better than no cache at all: If content needs to update frequently, set a short Cache-Control: max-age=60 header rather than disabling caching entirely. Even a 60-second cache protects the server from overload while keeping content fresh.

  • Do not disable PHP OPcache: OPcache caches compiled PHP code, not site content. Disabling it severely degrades performance without affecting content freshness.

  • Avoid unnecessary Set-Cookie headers: If a plugin sets a cookie for every anonymous visitor on the front page, nginx is forced to bypass the HTTP cache (BYPASS) for all visitors.

Purging and Bypassing the Cache

How to Purge the Cache for All Visitors

Always purge the server cache after major theme, code, or layout updates:

  • WordPress admin dashboard: Click Purge Cache in the top admin bar (clears both nginx and Redis caches).

  • Command line (SSH): Run wp-purge-cache to flush the entire site cache (nginx + Redis), or wp cache flush to clear only the Redis object cache.

How to Bypass the Cache Locally in Your Browser (Testing)

During development, bypass the cache locally so other visitors' experience and site performance remain unaffected:

  • Hard reload: Press Ctrl + F5 (Windows/Linux) or Cmd + Shift + R (macOS).

  • Browser developer tools: Open Developer Tools (F12), go to the Network tab, and check Disable cache (active while Developer Tools remain open).

  • Unique URL query parameter: Append a random query parameter to the URL, such as https://example.com/?nocache=123. nginx treats it as a new request and fetches a fresh response from PHP.

  • Private / Incognito window: Ensures a clean session without existing cookies or local browser cache.

Common Issues and Troubleshooting

  • Changes made to a page are not visible on the public site: Clear the server cache from the WordPress admin bar (Purge Cache) or via SSH using wp-purge-cache. If you use an external CDN or proxy service (such as Cloudflare), purge its cache as well.

  • X-Proxy-Cache consistently returns BYPASS even when logged out: A plugin or theme is setting an unnecessary cookie (Set-Cookie) on page load or sending a Cache-Control: no-cache / private header. Inspect the response headers in your browser's developer tools (Network → Response Headers) to identify which header is preventing caching.

  • Shopping cart or account pages display another user's data: Ensure no third-party page-caching plugin is active and verify that dynamic e-commerce pages (such as Cart, Checkout, and My Account) are not forced into the cache via custom nginx rules.

See Also

Seravo's multi-layered caching architecture keeps your site fast and stable even during heavy traffic spikes. If you need assistance configuring cache headers or improving your site's cache HIT ratio, our support team is happy to help at [email protected].

Did this answer your question?