Reduced minimum cache TTL for Workers KV to 30 seconds
The minimum cacheTtl parameter for Workers KV has been reduced from 60 to 30 seconds for both get() and getWithMetadata() methods, enabling finer-grained control over cache behavior and faster data refresh rates. The default cache TTL remains at 60 seconds, and users need to upgrade Wrangler to use the new 30-second minimum.
The minimum cacheTtl parameter for Workers KV has been reduced from 60 seconds to 30 seconds. This change applies to both get() and getWithMetadata() methods.
This reduction allows you to maintain more up-to-date cached data and have finer-grained control over cache behavior. Applications requiring faster data refresh rates can now configure cache durations as low as 30 seconds instead of the previous 60-second minimum.
The cacheTtl parameter defines how long a KV result is cached at the global network location it is accessed from:
// Read with custom cache TTL
const value = await env.NAMESPACE.get("my-key", {
cacheTtl: 30, // Cache for minimum 30 seconds (previously 60)
});
// getWithMetadata also supports the reduced cache TTL
const valueWithMetadata = await env.NAMESPACE.getWithMetadata("my-key", {
cacheTtl: 30, // Cache for minimum 30 seconds
});
The default cache TTL remains unchanged at 60 seconds. Upgrade to the latest version of Wrangler to be able to use 30 seconds cacheTtl.
This change affects all KV read operations using the binding API. For more information, consult the Workers KV cache TTL documentation.
Source: original entry ↗
More from Cloudflare
Follow Cloudflare to get its new changes in your feed and email digest.
Cloudflare One Client for Windows hotfix - trusted certificate chains
A new GA release for Windows Cloudflare One Client is available, addressing an issue with building trusted certificate chains.
Cloudflare One Client for macOS - Trusted Certificate Chain Fix
A new GA release of the macOS Cloudflare One Client is available. This hotfix addresses an issue with building trusted certificate chains.
Cloudflare One Client for Linux
A new GA release of Cloudflare One Client for Linux is now available. This hotfix addresses an issue with building trusted certificate chains.