megachangelog
Feature

Cache sharding with custom cache key values

Enterprise customers can now optimize cache hit ratios by sharding cache using up to ten values from previously restricted headers like accept, referer, and user-agent when configuring custom cache keys. This enables serving different cached versions based on device type, language, encoding preferences, and referrer, improving performance for content that varies by these factors.

Enterprise customers can now optimize cache hit ratios for content that varies by device, language, or referrer by sharding cache using up to ten values from previously restricted headers with custom cache keys.

How it works

When configuring custom cache keys, you can now include values from these headers to create distinct cache entries:

  • accept* headers (for example, accept, accept-encoding, accept-language): Serve different cached versions based on content negotiation.
  • referer header: Cache content differently based on the referring page or site.
  • user-agent header: Maintain separate caches for different browsers, devices, or bots.

When to use cache sharding

  • Content varies significantly by device type (mobile vs desktop).
  • Different language or encoding preferences require distinct responses.
  • Referrer-specific content optimization is needed.

Example configuration

{
  "cache_key": {
    "custom_key": {
      "header": {
        "include": ["accept-language", "user-agent"],
        "check_presence": ["referer"]
      }
    }
  }
}

This configuration creates separate cache entries based on the accept-language and user-agent headers, while also considering whether the referer header is present.

Get started

To get started, refer to the custom cache keys documentation.

Note

While cache sharding can improve hit ratios for specific use cases, overly sharding your cache can reduce overall cache efficiency and negatively impact performance. Carefully evaluate whether sharding benefits your specific traffic patterns.

cacheperformanceenterpriseheaders

Source: original entry ↗

More from Cloudflare

Follow Cloudflare to get its new changes in your feed and email digest.

Improvement2026.8.2100.0

Cloudflare One Client for macOS 2026.8.2100.0

GA release for macOS Cloudflare One Client with improved split tunnel handling that no longer briefly blocks traffic during reconnects, support for non-RFC 1918 local IPv4 networks, faster connects with lower memory use, and numerous reliability fixes across DNS, reauthentication, and client stability.

macosvpnreliabilityperformancedns
Improvement2026.8.2100.0

Cloudflare One Client for Windows 2026.8.2100.0

This GA release improves split tunnel reliability, adds support for non-RFC 1918 local networks, optimizes connection performance with faster reconnections and lower memory usage, and includes numerous bug fixes for DNS, registration, and network handling. The client now features a service recovery mechanism that automatically restarts on system unlock and better handles large hosts files without blocking traffic.

windowsvpnclienttunneldns
Improvement2026.8.2100.0

Cloudflare One Client for Linux 2026.8.2100.0

New GA release for Linux with improved split tunnel handling that no longer briefly blocks traffic during reconnects, support for non-RFC 1918 local IPv4 networks, faster tunnel reconnections, and lower memory usage. Includes numerous stability and reliability fixes for DNS, reconnection behavior, and crash issues.

linuxvpnclientperformancestability
See all Cloudflare changes →