Skip to main content
Blog|
Knowledge base

Caching

|
Feb 28, 2026|6 min read
KNOWLEDGE BASECachingHOSTNEYhostney.comAugust 21, 2023

Caching stores copies of your website’s pages and resources so they can be served instantly without running PHP or hitting the database on every request. Hostney gives you two caching layers: Nginx caching at the server level and Memcached for object caching inside your application.

Nginx caching#

Nginx caching works as a reverse proxy cache. When a visitor requests a page, Nginx checks if it already has a cached copy. If it does, the page is served directly from cache without touching PHP or your database. If not, the request goes through normally and the response gets cached for the next visitor.

Go to Caching > NGINX to get started. The page has two tabs: Caching and Exclusions.

Enabling caching

The Caching tab shows a table of all your websites with their current cache status. To enable caching on a website, click the dropdown menu on its row and select Settings.

The enable modal lets you configure three options:

  • Cache duration – How long pages stay cached before Nginx refreshes them from your application. Options are 30 minutes, 1 hour, 4 hours (default), 6 hours, or 24 hours. For most websites, 4 hours is a good balance between performance and freshness.
  • Ignore cache-control headers – When checked, Nginx caches responses even if your application sends no-cache or private headers. This is safe for WordPress and Drupal because logged-in users bypass the cache automatically.
  • Cache query strings – When checked, URLs with query parameters get cached separately. Common tracking parameters like utm_source, gclid, and fbclid are handled safely regardless of this setting.

Click Enable caching to apply. Changes take 1-2 minutes to reach your server.

For WordPress sites, you can safely enable caching with the defaults. The system is preconfigured to exclude logged-in users, shopping carts, and admin pages from caching.

The caching table

Each row in the table shows:

  • Website – The domain name
  • Caching – Whether caching is enabled, and the current cache size if it is
  • Duration – How long pages are cached (30m, 1h, 4h, 6h, or 24h)
  • Headers – Whether cache-control header ignoring is on (green check) or off (gray dash)
  • Query – Whether query string caching is on or off

Disabling caching

Click Settings in the dropdown menu on an enabled website. The disable modal gives you the option to flush the cache at the same time. Check Flush cache if you want to clear all cached content when disabling.

On managed WordPress installations, caching automatically re-enables after 1 hour to keep your site performing well.

Purging specific URLs

If you updated a specific page and want visitors to see the new version immediately, you don’t need to flush the entire cache. Click Purge URLs from the dropdown menu on any cached website.

In the modal:

  1. Enter the URLs you want to purge, one per line. You can use full URLs (like  https://example.com/about/ ) or just paths (like  /about/ ). Maximum 100 URLs per request.
  2. Optionally check Prefix mode to purge everything under each path. For example,  /blog/  in prefix mode purges  /blog/post-1/ /blog/post-2/ , and everything else under  /blog/ .
  3. Click Purge URLs.

After purging, the modal shows results for each URL: whether it was found in cache and purged, or wasn’t cached in the first place.

Flushing the entire cache

Click Flush cache from the dropdown menu to clear all cached content for a website. The next visitors will trigger fresh responses from your application, which then get cached again.

Cache exclusions

The Exclusions tab lets you prevent specific content from being cached. There are two types of exclusions:

Cookie exclusions – If a visitor’s browser sends a cookie matching the exclusion, the request bypasses the cache entirely. This is how logged-in users get fresh content. WordPress and Drupal cookies are already preconfigured.

URI exclusions – Requests to paths matching the exclusion skip the cache. Use this for admin panels, dashboards, or any page that should always be dynamic. For example, adding /admin excludes everything under that path from caching.

To add an exclusion:

  1. Select the website.
  2. Choose the exclusion type (Cookie or URI).
  3. Enter the value. For cookies, enter the cookie name (e.g.,  wp_logged_in ). For URIs, enter the path (e.g.,  /admin ).
  4. Click Add exclusion.

The exclusions table below shows all active exclusions with their website, type, and value. Click the dropdown menu on any row to delete an exclusion.

If you’re running WordPress or Drupal, the default exclusions handle logged-in users and admin areas automatically. You only need to add custom exclusions if you have additional authenticated areas or third-party integrations that shouldn’t be cached.

Memcached#

Memcached is an in-memory object cache that your application uses to store frequently accessed data like database query results, session data, or computed values. Instead of running the same database query on every page load, your application can store the result in Memcached and retrieve it in microseconds.

Go to Caching > Memcached to get started.

Availability

Memcached is included in certain hosting plans. If your plan doesn’t include it, you’ll see a message with an option to upgrade. The allocated memory depends on your plan.

Connection details

The top of the page shows your connection information:

  • Socket path – Something like  /home/youruser/.memcached/cache.sock . This is the recommended connection method for best performance. Use the copy button to grab it.
  • TCP address (if available) –  127.0.0.1:port  as an alternative for applications that only support host:port connections.

You’ll need one of these values when configuring your application or caching plugin. For WordPress, plugins like W3 Total Cache or WP Rocket can use the socket path directly.

Enabling and disabling

Below the connection details, the service status shows whether Memcached is currently enabled or disabled, along with the allocated memory (e.g., “64 MB allocated”).

  • Click Enable to start the Memcached service for your account.
  • Click Disable to stop it.
  • Click Flush cache to clear all cached data without disabling the service.

Cache browser

When Memcached is active, a cache browser section appears with two parts:

Cache statistics – Four cards showing:

  • Memory usage – How much of your allocated memory is in use, with a color-coded progress bar (blue under 70%, yellow 70-90%, red above 90%)
  • Hit rate – The percentage of requests served from cache versus cache misses. A high hit rate means your caching is working well.
  • Cached items – How many items are currently stored, plus the number of evictions (items removed to make room for new ones)
  • Uptime – How long the service has been running and the number of active connections

Cached keys – A searchable, sortable table listing every cached key with:

  • Key – The cache key name (e.g.,  wp:post:123:cache )
  • Size – How much memory the entry uses
  • Expires – Time until the entry expires, or “No expiry” for persistent entries
  • Last access – How long ago the entry was last read

The table shows up to 1,000 keys. If your cache has more, a warning appears letting you know the list is truncated.

For each key, the dropdown menu gives you two options:

  • View value – Opens a modal showing the cached data with a copy button. Large values are truncated to the first 10 KB with a note showing the full size.
  • Delete key – Removes the key from cache after typing DELETE to confirm.

Related articles