Commit bea87e7
Improve rate limits and add caching for shared-IP environments
Partners like bioRxiv/medRxiv make multiple unauthenticated search API
calls per page load (2 groups x paginated at limit=50). In shared-IP
environments (conferences, universities), all users share one rate
limit bucket, causing 429s.
Changes:
- Bump general API rate limit from 4r/s burst=44 to 10r/s burst=200
- Bump badge rate limit from 1r/s burst=15 to 10r/s burst=100
- Add Cache-Control: public, max-age=60 on unauthenticated search
responses and all badge responses (identical queries from shared-IP
users now served from CloudFlare/browser cache)
- Enable nginx JSON access logging for rate limit visibility
- Increase rate limit zone memory from 1m to 2m (~16k users)
Ref: product-backlog#1716
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 555633a commit bea87e7
File tree
6 files changed
+517
-9
lines changed- conf
- docs
- h/views
- api
- tests/unit/h/views
- api
6 files changed
+517
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
24 | 37 | | |
25 | 38 | | |
26 | 39 | | |
| |||
31 | 44 | | |
32 | 45 | | |
33 | 46 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
39 | 52 | | |
40 | 53 | | |
41 | 54 | | |
| |||
96 | 109 | | |
97 | 110 | | |
98 | 111 | | |
99 | | - | |
| 112 | + | |
100 | 113 | | |
101 | 114 | | |
102 | 115 | | |
| |||
120 | 133 | | |
121 | 134 | | |
122 | 135 | | |
123 | | - | |
| 136 | + | |
124 | 137 | | |
125 | 138 | | |
126 | 139 | | |
127 | 140 | | |
128 | 141 | | |
129 | 142 | | |
130 | 143 | | |
131 | | - | |
| 144 | + | |
132 | 145 | | |
133 | 146 | | |
134 | 147 | | |
| |||
0 commit comments