when running workers-rs with wrangler on local mode, my code attempts to store a value on the key value database, (no errors), but when i check the dashboard on cloudflare, there doesn't seem to actually be anything stored
Keep in mind that because KV is eventually consistent if you read a value then change the value with the same key it might take up to 60s to see the new value in other locations
Easy way to test, actually - if you call multiple times in a row, if the calls all take then same time then they don't get cached, if the first is slower than the rest they do get cached.
They get cached for the exact same sets of parameters. The cache key is built from the parameters (prefix, limit, or cursor) and cached for max 1 minute (IIRC you can't customize the cache TTL currently).
It shouldn’t. If you’re doing writes concurrently then it’s possible you cached the end of the list and need to wait a minute or so. What’s your namespace?
Which geographic location is this happening in and are you sure the gets are happening on a key that’s supposed to be already cached? Also is this a change in behavior or a new measurement you’re looking at
My bad, I thought Region: Earth meant all the data was replicated globally? I’m in Australia so if both reads and writes are going somewhere off-continent that would explain these figures
Correct. https://developers.cloudflare.com/workers/learning/how-kv-works/. So yeah, writes from Australia may take a while. The first read ever for a key will be slow but subsequent reads should be fast. The reads don’t even need to be from the same data center. Anywhere in Australia will populate the cache for all of Australia.
When you say "reminder that you can only list 1k at a time", do you mean that a page is only 1k max, or that all the pages can't return more than 1,000 items?
Again, I'm not 100% clear. Let's say I have 10,000 keys that match my prefix. I make an initial list() call with that prefix and I'll get back a page plus a cursor. I can use that cursor on followup list() calls to get more pages. When it's all said and done, can I get back all 10,000 keys?