TsgcWSRateLimiter › Properties › BurstProtection
Short-timescale spike detector that puts abusive keys into a cooldown.
property BurstProtection: TsgcRateLimitBurst read FBurstProtection
write SetBurstProtection;
—
Runs in parallel with the main strategy. If more than BurstThreshold requests arrive from the same key within BurstWindowMs milliseconds, the key is placed in a cooldown for CooldownSec seconds during which every request is rejected — even if the main strategy would have allowed them. Designed to catch scrapers and scanners that flood a server with 100+ requests in 100 ms bursts but stay under per-minute limits: a pattern that a human user never produces.
// More than 50 requests in 500ms triggers a 30-second cooldown
sgcWSRateLimiter1.BurstProtection.Enabled := True;
sgcWSRateLimiter1.BurstProtection.BurstThreshold := 50;
sgcWSRateLimiter1.BurstProtection.BurstWindowMs := 500;
sgcWSRateLimiter1.BurstProtection.CooldownSec := 30;