All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

KV - Reduced minimum cache TTL for Workers KV to 30 seconds

5mo ago

Source

CloudflareKV - Reduced minimum cache TTL for Workers KV to 30 secondscloudflare.com
Snippet from the RSS feed
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 .

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.