Workers KV now supports bulk reads for up to 100 keys
Workers KV now supports bulk reads to retrieve up to 100 keys in a single request, enabling more efficient multi-key operations within a Worker invocation and avoiding connection limits of individual requests.
You can now retrieve up to 100 keys in a single bulk read request made to Workers KV using the binding.
This makes it easier to request multiple KV pairs within a single Worker invocation. Retrieving many key-value pairs using the bulk read operation is more performant than making individual requests since bulk read operations are not affected by Workers simultaneous connection limits.
// Read single key
const key = "key-a";
const value = await env.NAMESPACE.get(key);
// Read multiple keys
const keys = ["key-a", "key-b", "key-c", ...] // up to 100 keys
const values : Map<string, string?> = await env.NAMESPACE.get(keys);
// Print the value of "key-a" to the console.
console.log(`The first key is ${values.get("key-a")}.`)
Consult the Workers KV Read key-value pairs API for full details on Workers KV's new bulk reads support.
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.