Closed ericallam closed 1 year ago
I was going to volunteer for this one if that's cool. Is there a provider or specific Redis service that I should use? Here's a list of some Redis cache services:
Amazon ElastiCache for Redis Google Cloud Memorystore for Redis Microsoft Azure Cache for Redis IBM Cloud Database for Redis Oracle Cloud Infrastructure Cache Heroku RedisGreen Redis Labs Redis on Flash (RoF) Heroku Redis Scaleway Redis Upstash
Currently JSONHero is meant to be deployed to Cloudflare on Cloudflare workers, so we have access the Cloudflare KV and Cloudflare DurableObjects, one of which might make sense for this rate-limiter? I'm guessing DurableObjects would be a better fit but I haven't looked into it.
Also I'm thinking the initial rate limit should be at most 10 per minute per IP, but would be good to control this with an env var
/bounty $400
/attempt #158
@ericallam taking a look at DurableObjects
@daveads i think hold off for now. It actually probably doesn't make sense to include the rate limiter in code as self-hosters wouldn't really need it and we can instead use Cloudflare firewall to rate limit JSONHero.io. I'm going to close this issue for now, hoping you didn't spend too much time on this.
@ericallam I don't think this even needs to be hard coded with Cloudflare workers. You can create a rate limiter based on the IP by going onto the dashboard and setting the rule on your firewall. Here is a link:
Currently there is no rate limiter on the jsonhero.io cloud, but we should probably add one to prevent abuse