HTTP RateLimit headers
41 points by fanf
41 points by fanf
We all know why this topic is gaining importance. It’s a f…ing disgrace that the response to unlimited scraping is putting the onus on individual servers. Again.
From a technical perspective, I'm not sure what else is possible with our current stack. Everyone is vulnerable to DDoS under a certain amount of traffic loading.
We need a internet protocol where requests get cheaper the more common they are so the asymmetry is flipped.
I wrote a novel (AFAIK) cooperation algorithm for GCRA clients. This post walks through the process https://www.schneems.com/2020/07/08/a-fast-car-needs-good-brakes-how-we-added-client-rate-throttling-to-the-platform-api-gem/
I see that RateLimit-Policy tries to cover wide scenarios and that results in a complex header. Some examples taken from the draft:
RateLimit-Policy: "burst";q=100;w=60,"daily";q=1000;w=86400
RateLimit-Policy: "default";q=100;w=10
RateLimit-Policy: "peruser";q=65535;qu="content-bytes";w=10;pk=:sdfjLJUOUH==:
A header must to carry metadata about a request or response, like RateLimit, not a complex policy that belongs to a group of requests, in this case with the same partition key. Headers were designed to be frugal.
But with the current scenario, as suggestion, maybe extend (a bit more) Content-Security-Policy with a simple definition combined with an static file in /.well-known/ratelimit.