Files
growstuff/config/initializers
Brenda WallaceandClaude Opus 5 bd545b5ce6 Throttle /activities and /api/v1/activities per IP
/api/v1/activities is the single busiest route in production: 216 of 1101
requests in a 14 minute log window, 19.6% of all traffic and 21.7% of
non-asset traffic. It was the only high-volume route with no rate limit,
since the throttle matched plantings, harvests and members only.

Collapses the two alternations into one regex with an optional /api/v1
prefix, so the HTML and API routes stay in step instead of being listed
twice. Verified equivalent to the old pair across both route families
plus their edge cases: /plantingsfoo, /memberships, /foo/plantings and
/api/v2/activities are still unmatched.

Note this does not by itself stop the client currently polling that
endpoint. It makes 189 requests over 21 minutes, about 9 per minute,
which is under the 15 per minute limit, and Rack::Attack counters live
in per-worker memory so at WEB_CONCURRENCY=2 each worker sees only half
of them. This closes the hole rather than fixing today's load.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-20 21:51:52 +12:00
..
2026-09-20 16:04:15 +09:30
2020-01-10 16:50:52 +13:00
2020-01-21 22:26:08 +13:00
2020-01-10 16:50:52 +13:00
2025-09-20 10:15:41 +00:00
2020-01-10 16:50:52 +13:00
2025-09-20 10:15:41 +00:00
2025-08-24 07:03:20 +00:00
2024-01-07 01:57:19 +00:00
2024-01-07 01:57:19 +00:00
2020-01-10 16:50:52 +13:00
2020-01-10 16:50:52 +13:00
2020-01-10 16:50:52 +13:00
2020-01-10 16:50:52 +13:00