Repository navigation
Commit 8feaa6d
committed
feat(blog): rate limiting a Node.js API across many instances
A recipe for @imqueue/http-protect behind several gateway instances
sharing one Redis: the shared counter, what its TTL-based count really
measures, resolving the client address safely behind a proxy (the default
trusts X-Forwarded-For from anyone, which lets a client dodge the limit,
claim a safe network or get a customer banned), the ::ffff: form that
defeats safeNetworks, lifting a permanent ban, Retry-After, and failing
fast when Redis is down. Measured on http-protect 3.0.3, Express 5 and
Redis 8. The security hub description now names it.
The search index's tier-2 budget goes from 400 to 440 KB, in both the
generator and the check, as its own comment prescribes when it fires: the
site was at 398.2 KB before this post and 404.7 KB with it, with tier 1 at
96.2 of 120 KB.1 parent a11b98e commit 8feaa6d
6 files changed
Lines changed: 470 additions & 4 deletions
File tree
- images/blog
- scripts
- src
- _data
- org/blog/posts
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | | - | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
0 commit comments