Cloudflare Developers

CD

Cloudflare Developers

Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news

Join

The above question I think I found the

The above question I think I found the answer as API's appear to be limited to 1200 requests/5 minutes for basically any API on cloudflare.

Has expiration_ttl now gone from the V4

Has expiration_ttl now gone from the V4 API (for a KV write with metadata). I can only see it in the OpenAPI spec comment and it doesn't seem to work in practice anymore.

I'm using Cloudflare Pages with KV.

I'm using Cloudflare Pages with KV. My goal is to set up KV for different environments, to have: 1. one KV id for production, and 2. another KV id for all other environments (preview URLs, local dev with miniflare maybe, etc)...

How do you modify every KV entry without

How do you modify every KV entry without being ratelimited? "Error: Too many API requests by single worker invocation."...

Yeah so I had a line that looked like

Yeah so I had a line that looked like this to test (and I'm aware I believe just putting overwrites but I was testing something iirc): ```js await env.<namespace>.delete(<item>) await env.<namespace>.put(<item>)...

Hey, I am seeing some pretty horrendous

Hey, I am seeing some pretty horrendous latencies using workers with KV, requests to get a 3.6MB value are taking up to 10 seconds at times, this is from a london IP and the KV was created by me from an IP in the UK too. Not sure why sometimes the latencies are so bad, I was using this to speed up a bunch of queries that we would usually make to R2 as range requests, but it appears sometimes KV is substantially slower? Any ideas what could be going on here?

KV vs DO for link shortening

Ok thanks. Every request activates for 30s, if I understand correctly. Makes sense. Then after reading through the docs I can see that the recommendationis to not use single global objects, so I think "object per link entity" would be the way to go here. I still struggle to wrap my head around why/how Durable Objects are the best fit for this use case. They're certainly cool and powerful, but I don't really need all the extra guarantees. All I'd really need is a bit of a narrower windows for eve...

yea I would check the other limits:

yea I would check the other limits: https://developers.cloudflare.com/kv/platform/pricing/, you only get 1,000 List reqs/day

kv is really slow to propagate when i

kv is really slow to propagate when i have my backend reading it it takes sometimes 3 minutes to get a new value. should i keep using KV or is there some solution?

I’ve been noticing that my get requests

I’ve been noticing that my get requests to a kv store have had the latency gradually increasing overtime. This latency changes depending Inside of the worker code edit page, when my worker is run, all 30ms of the wall click time utilized is caused by my get request to a kv storage after 5 requests, before then I’m seeing up to 400ms of time waiting for the get requests to complete. On my end client is interacting with a worker, the median response time is sitting at 200ms after 300 requests. ...

Workers KV bulk reads

Is there a way that a bulk get can be implemented for cloudflare KVs? Like in a way that can keep the limit but only require one call to limit the number of requests that are required to be sent for large data querying? For example, I want to create a bulk endpoint for a large number of lookups. Currently, my client is held up by making thousands of requests which are held up by browser limitations. If I can bundle them in say 200-300 requests to a bulk endpoint it would save my client very prec...

Im needing some help with kv fetching. I

Im needing some help with kv fetching. I am using BetterKV for fetching a rarely-updated value (but pretty important to have latest value with semi-low latency). This value is actually stored in my db and passed into kv and cached for performance (i believe kv w/ caching is faster for global users but I need to still actually do performance testing). Ideally, I want the cacheTtl and kvCacheTtl to be high for low latency, but I dont want to have to wait for kvCacheTtl to expire to fetch th...

Is there a way to deal with the

Is there a way to deal with the graveyard that is created from unread items being deleted by the TTL? Had about 5 GB of unread data expire and now we cannot get to the valid data with list because it’s stuck churning through the graveyard. We don’t want to delete and recreate the kv store since it’s tied to multiple apis inputting data to them and being read by workers

anyone can help me underestand one point

anyone can help me underestand one point? im storing the url path as key of kv todo a rudimentary cache layer for some responses. but when i search on the GUI, none of the stored data shows on, it works fine on code but i cant check on the GUI. Theres any limitation for search keys started with / or having any special caracteres?

Yikes, that's really disappointing.

Yikes, that's really disappointing. Thanks for the info. I'm coming to the realisation that CF is only really beneficial for very high traffic sites -- I wonder if all CDNs are as quick to evict cache entries....

that sounds expensive

that sounds expensive

You can't configure the KV origins. As

You can't configure the KV origins. As for an immutable Cache, would a single DO per region not work?

i got a question when reading metadata

i got a question when reading metadata from a key

You're quite close!

You're quite close! Two small changes needed: - KV = "TEST" assigns the string to the KV variable, instead of the KV namespace. In the old service worker syntax, removing this line would've been your solution, as bindings were global variables. In module workers (ones with export default), they are available on the env variable which is the second parameter of your fetch function in line 4, so on line 5 and 6 you should change it to env.KV.put and env.KV.get. - You'll need to actually bind your worker to this KV namespace you created, which in the dashboard you can do by clicking on Workers & Pages, selecting your worker, clicking on the Settings tab, and scrolling down to KV Namespace bindings. There, you'll need to select the KV namespace you created (Edit Variables, Add binding) and give it a name that it will be made available as (KV in the example). Saving it should create a new deployment where the namespace you selected is available as env.KV meowparty