honzabit
honzabit
CDCloudflare Developers
Created by Gagan Suie on 3/27/2024 in #workers-help
Certain get request not working in workers. but works in browser
Well, at some point the request might return a TLS error, even from the browser (try hard-refreshing multiple times). So maybe it's not your problem. You can put a retry on fetch in case of such error.
6 replies
CDCloudflare Developers
Created by zachery on 3/27/2024 in #workers-help
Suggestion for rate limiting
the in-memory state can help you (a) assuming that each api key will connect to the same edge node (not always true), and (b) you will not allow bursts, and so that, by enforcing the X/sec you will be also enforcing the Y/hour. Otherwise, you would need a persistent store.
6 replies
CDCloudflare Developers
Created by Gagan Suie on 3/27/2024 in #workers-help
Certain get request not working in workers. but works in browser
curl -XGET returns the json data and it sends these request headers:
> Host: ingest.twitch.tv
> User-Agent: curl/8.4.0
> Accept: */*
> Host: ingest.twitch.tv
> User-Agent: curl/8.4.0
> Accept: */*
6 replies
CDCloudflare Developers
Created by zachery on 3/27/2024 in #workers-help
Suggestion for rate limiting
can you give more details of the type of rate-limiting you want to implement? e.g. "for every ip_address, allow X requests per Y timeframe". The solution really depends, because if you want to impose a 50 reqs/second limitation (wild example) there is no reason to use anything other than worker's memory state (and accept the evictions as the only con). On the other hand, if you would like to impose a rule like "allow X requests per day on /blog", this is a static rule that would fit in every plan's allowance of CF rate limiting rules, so no-code at all.
6 replies
CDCloudflare Developers
Created by Lando Calrissian on 9/26/2023 in #workers-help
Worker refusing to recognize KV namespace even after binding
Based on the naming of the KV, I would suggest you switch to DOs instead, as KVs are eventually consistent and cannot be used for the purpose of "counting" hits. Check my reply here on another thread, regarding this misconception: https://discord.com/channels/595317990191398933/1155937065926672384/1156581670661652590
12 replies
CDCloudflare Developers
Created by honzabit on 9/26/2023 in #general-help
Cache not fragmented by protocol?
Thanks for your input @HardAtWork, I will do some tests and get back with any findings 🙂
6 replies
CDCloudflare Developers
Created by honzabit on 9/26/2023 in #general-help
Cache not fragmented by protocol?
SSL on that zone is set on 'Flexible'
6 replies
CDCloudflare Developers
Created by eshnil on 8/26/2023 in #workers-help
Can I use Env for caching database results?
you correctly answered that this will not work as you wish, you need to check Durable Objects for this use-case
2 replies