{"id":192,"date":"2026-01-30T12:00:00","date_gmt":"2026-01-30T12:00:00","guid":{"rendered":"https:\/\/wordpress.securinsight.ca\/index.php\/2026\/01\/30\/kv-reduced-minimum-cache-ttl-for-workers-kv-to-30-seconds\/"},"modified":"2026-01-30T12:00:00","modified_gmt":"2026-01-30T12:00:00","slug":"kv-reduced-minimum-cache-ttl-for-workers-kv-to-30-seconds","status":"publish","type":"post","link":"https:\/\/wordpress.securinsight.ca\/index.php\/2026\/01\/30\/kv-reduced-minimum-cache-ttl-for-workers-kv-to-30-seconds\/","title":{"rendered":"KV &#8211; Reduced minimum cache TTL for Workers KV to 30 seconds"},"content":{"rendered":"<p>The minimum <code>cacheTtl<\/code> parameter for Workers KV has been reduced from 60 seconds to 30 seconds. This change applies to both <code>get()<\/code> and <code>getWithMetadata()<\/code> methods.<\/p>\n<p>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.<\/p>\n<p>The <code>cacheTtl<\/code> parameter defines how long a KV result is cached at the global network location it is accessed from:<\/p>\n<div>\n<figure>\n<pre data-language=\"js\"><code class=\"language-js\"><div><div><span>\/\/ Read with custom cache TTL<\/span><\/div><\/div><div><div><span>const<\/span><span> <\/span><span>value<\/span><span> <\/span><span>=<\/span><span> <\/span><span>await<\/span><span> <\/span><span>env<\/span><span>.<\/span><span>NAMESPACE<\/span><span>.<\/span><span>get<\/span><span>(<\/span><span>\"my-key\"<\/span><span>,<\/span><span> <\/span><span>{<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>cacheTtl<\/span><span>:<\/span><span> <\/span><span>30<\/span><span>,<\/span><span> <\/span><span>\/\/ Cache for minimum 30 seconds (previously 60)<\/span><\/div><\/div><div><div><span>}<\/span><span>)<\/span><span>;<\/span><\/div><\/div><div><div>\n<\/div><\/div><div><div><span>\/\/ getWithMetadata also supports the reduced cache TTL<\/span><\/div><\/div><div><div><span>const<\/span><span> <\/span><span>valueWithMetadata<\/span><span> <\/span><span>=<\/span><span> <\/span><span>await<\/span><span> <\/span><span>env<\/span><span>.<\/span><span>NAMESPACE<\/span><span>.<\/span><span>getWithMetadata<\/span><span>(<\/span><span>\"my-key\"<\/span><span>,<\/span><span> <\/span><span>{<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>cacheTtl<\/span><span>:<\/span><span> <\/span><span>30<\/span><span>,<\/span><span> <\/span><span>\/\/ Cache for minimum 30 seconds<\/span><\/div><\/div><div><div><span>}<\/span><span>)<\/span><span>;<\/span><\/div><\/div><\/code><\/pre>\n<div>\n<div><\/div>\n<\/div>\n<\/figure>\n<\/div>\n<p>The default cache TTL remains unchanged at 60 seconds. Upgrade to the latest version of Wrangler to be able to use 30 seconds <code>cacheTtl<\/code>.<\/p>\n<p>This change affects all KV read operations using the binding API. For more information, consult the <a href=\"https:\/\/developers.cloudflare.com\/kv\/api\/read-key-value-pairs\/#cachettl-parameter\">Workers KV cache TTL documentation<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-192","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/comments?post=192"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/192\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/media?parent=192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/categories?post=192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/tags?post=192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}