Edge Key-Value Storage: Cache TTL, Bulk Reads, and Eventual Consistency
What Cloudflare Workers KV is for, how caching and consistency behave, limits, bulk reads, and legacy API route migration deadlines.
This page summarises Cloudflare Workers KV documentation: a globally distributed, eventually consistent key-value store meant for read-heavy workloads such as configuration, sessions, routing tables, and edge caching. It is not a substitute for a strongly consistent database.
Workers KV: what it is and when to use it
Section titled “Workers KV: what it is and when to use it”Workers KV is an eventually consistent key-value data store that caches on the Cloudflare global network.
Workers KV is an eventually consistent key-value data store that caches on the Cloudflare global network.
— Cloudflare, Choose a data or storage product
Cloudflare recommends it for data that is read often, changed rarely, and does not need immediate global consistency—for example session data, API keys, configuration, allow-lists, and cached responses. Hot keys typically see latencies in roughly the 500µs to 10ms range because of KV’s internal cache.
KV is a poor fit when you need atomic read-modify-write in one transaction or the same key updated many times per second (maximum 1 write per second per key). For stronger consistency or higher write rates on a single key, Cloudflare points to Durable Objects in How KV works.
| Typical fit | Poor fit |
|---|---|
| Configuration, feature flags, routing rules | Same key updated tens/hundreds of times per second |
| Sessions and credentials read at high RPS | Strong consistency or transactions required |
| Caching and static asset serving | Relying on instant visibility of writes worldwide |
Values are capped at 25 MiB per key; consolidating many small configs into one key can improve cache efficiency when the blob stays small enough to manage—see Build a distributed configuration store.
How Workers KV works: hot reads, cold reads, and central stores
Section titled “How Workers KV works: hot reads, cold reads, and central stores”KV keeps data in a small number of central data stores, then caches it in Cloudflare data centers after access.
KV is a global, low-latency, key-value data store. It stores data in a small number of centralized data centers, then caches that data in Cloudflare’s data centers after access.
— Cloudflare, How KV works
A hot read means the value is already cached at the edge (local or regional CDN cache). A cold read misses cache and must reach regional tiers, then central stores—slower on first access, faster on repeat reads from the same location.
Writes go to central stores first; data is not pushed automatically to every edge cache. That design is why reads can lag writes in distant locations.
cacheTtl: edge cache duration and the 30-second minimum
Section titled “cacheTtl: edge cache duration and the 30-second minimum”The cacheTtl parameter sets how long (in seconds) a KV result stays cached at the global network location where it was read.
cacheTtl is a parameter that defines the length of time in seconds that a KV result is cached in the global network location it is accessed from.
— Cloudflare, Read key-value pairs
| Setting | Value |
|---|---|
Default cacheTtl |
60 seconds |
Minimum cacheTtl |
30 seconds (binding get() / getWithMetadata()) |
| Maximum | Number.MAX_SAFE_INTEGER |
Raising cacheTtl above the default can reduce cold-read cost for rarely changing data. Lowering it (down to 30 seconds) helps when you need fresher cached reads—but only if you accept that other locations may still serve older cached values until their TTL expires.
Use the latest Wrangler to rely on a 30-second minimum; details are in Reduced minimum cache TTL for Workers KV to 30 seconds.
Why you do not see an updated KV value right away
Section titled “Why you do not see an updated KV value right away”Workers KV caches heavily at the edge, so a read may return a stale value until the cache TTL elapses.
Workers KV heavily caches data across the Cloudflare network. Therefore, it is possible that you read a cached value for up to the cache TTL duration.
— Cloudflare, FAQ
Negative lookups (key missing) are cached too, so creating a new key can appear delayed in regions that recently saw “not found.” Expiration on a key always wins over a longer cacheTtl on reads—see Write key-value pairs.
Workers KV consistency: writes, concurrent updates, and regions
Section titled “Workers KV consistency: writes, concurrent updates, and regions”Workers KV is eventually consistent.
Workers KV is eventually consistent.
— Cloudflare, FAQ
Changes are often visible quickly in the location where the write happened, but Cloudflare does not guarantee that; other locations may take up to about 60 seconds or more (or your read’s cacheTtl) to see the new value. Concurrent writes to the same key overwrite each other; the last write wins. The write rate limit is 1 PUT per second per key; faster writes can return 429 Too Many Requests—see Write key-value pairs.
Workers KV limits: namespaces, operations, and bulk reads
Section titled “Workers KV limits: namespaces, operations, and bulk reads”Account and plan limits are documented in Limits. Highlights for standard Workers KV:
| Feature | Free | Paid |
|---|---|---|
| Reads | 100,000 / day | Unlimited |
| Writes to different keys | 1,000 / day | Unlimited |
| Writes to same key | 1 / second | 1 / second |
| Operations per Worker invocation | 1,000 | 1,000 |
| Namespaces per account | 1,000 | 1,000 |
| Value size | 25 MiB | 25 MiB |
Minimum cacheTtl |
30 s | 30 s |
Namespaces per account rose from 200 to 1,000 on all plans—Workers KV namespace limits increased to 1000.
Bulk reads: up to 100 keys in one binding operation
Section titled “Bulk reads: up to 100 keys in one binding operation”You can pass an array of keys to env.NAMESPACE.get(keys) and receive a Map of results—up to 100 keys per bulk read.
You can now retrieve up to 100 keys in a single bulk read request made to Workers KV using the binding.
— Cloudflare, Read multiple keys from Workers KV with bulk reads
Bulk reads count as one operation toward the 1,000 external operations per Worker invocation and are not split into one subrequest per key—FAQ. On paid plans, billing is per key read in the bulk operation—Pricing.
Coalescing many small keys into one “super” JSON value can keep cold fields warm but complicates independent updates and locking; trade-offs are in Read key-value pairs.
Workers KV access: binding API versus REST API
Section titled “Workers KV access: binding API versus REST API”| Access path | Performance | Notes |
|---|---|---|
| Workers binding API | Generally faster (no extra HTTP hop) | Preferred from Workers; supports bulk reads and cacheTtl |
| REST API / SDKs | Subject to Cloudflare REST rate limits | Usable without Workers—FAQ |
Dashboard and Wrangler list/write/delete operations count as billable KV usage. Key expirations are not billed as deletes—FAQ and Pricing. Fetches for missing keys still bill as operations.
Values are encrypted at rest (AES-256-GCM) and in transit (TLS); see Data security. By default, data is stored in central KV stores without jurisdictional restriction and cached globally—Data location.
Cloudflare reported lower read latencies after a hybrid storage rollout (for example roughly ~150ms to ~50ms p95 in some regions)—Workers KV completes hybrid storage provider rollout.
Legacy Workers KV namespace API routes: migrate before October 2026
Section titled “Legacy Workers KV namespace API routes: migrate before October 2026”HTTP integrations must move from /accounts/{account_id}/workers/namespaces/* to /accounts/{account_id}/storage/kv/namespaces/*.
The legacy Workers KV API routes under
/accounts/{account_id}/workers/namespaces/*are deprecated in favor of the Workers KV API routes under/accounts/{account_id}/storage/kv/namespaces/*.— Cloudflare, API deprecations
| Milestone | Date |
|---|---|
| Deprecation | July 15, 2026 |
| End of life (legacy paths stop working) | October 15, 2026 |
Legacy and replacement routes accept the same parameters and return the same payloads; migration is a path substitution—Deprecate legacy Workers KV namespace API routes. Full endpoint mapping is in API deprecations.
If you use Cloudflare SDKs, upgrade past the KV value update bug (cloudflare-typescript 4.5.0+, cloudflare-python 4.4.0+) when JSON values were double-wrapped—Terraform provider improvements.
Common mistakes with Workers KV
Section titled “Common mistakes with Workers KV”- Treating KV like Redis and hammering one key with multiple writes per second (429 errors).
- Setting a low
cacheTtlwhile expecting instant global read-after-write consistency. - Using KV for atomic counters or transactional inventory without Durable Objects or another coordination layer.
- Ignoring that list/get from Dashboard or Wrangler still consumes daily or monthly quotas.
- Leaving automation on deprecated
/workers/namespaces/URLs past October 15, 2026. - Coalescing keys into one large value without a safe update strategy (race conditions, Worker memory limits).
Example workloads and patterns: Route requests across various web servers, Cache data with Workers KV, and Store application data.
How to check this on your site
Section titled “How to check this on your site”-
Open the Cloudflare Dashboard Workers KV UI, confirm namespace count stays within Limits, and spot-check keys and analytics after the updated KV homepage rollout—New Workers KV Dashboard UI.
-
From a bound Worker, read a test key with
cacheTtl: 30and compare behavior to the default 60 seconds using guidance in Read key-value pairs and Reduced minimum cache TTL. -
If you read many keys per request, verify a single
get([...])bulk call (≤100 keys) and confirm billing expectations in Pricing and FAQ. -
Search your deployment for
workers/namespacesin API clients and confirm calls targetstorage/kv/namespacesbefore the October 15, 2026 end of life. -
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about.