aurweb/upgrading/4.7.0.txt
Florian Pritz 27654afadb Add rate limit support to API
This allows us to prevent users from hammering the API every few seconds
to check if any of their packages were updated. Real world users check
as often as every 5 or 10 seconds.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-02-24 14:57:31 +01:00

11 lines
265 B
Text

1. Add ApiRateLimit table:
---
CREATE TABLE `ApiRateLimit` (
IP VARCHAR(45) NOT NULL,
Requests INT(11) NOT NULL,
WindowStart BIGINT(20) NOT NULL,
PRIMARY KEY (`ip`)
) ENGINE = InnoDB;
CREATE INDEX ApiRateLimitWindowStart ON ApiRateLimit (WindowStart);
---