Cache DeviantArt API responses in memory !8

merged merged by cmc on 2026-09-11 15:13 UTC · krz/skunky-art:feat/api-cache into main

Discussion

cmc

Stacked on !7; retarget to main once that merges.

A caching RoundTripper in front of the throttle. GETs to www.deviantart.com/_puppy/… and /groups/ with a 200 are stored, keyed by URL minus csrf_token, bounded by bytes with LRU eviction, with singleflight so concurrent misses for one URL make one upstream call. The session bootstrap, homepage scrape, avatars and media pass through. Non-200 responses are never stored.

Config block api-cache (enabled true, max-size 64 MB, ttl 5i by default), documented in SETUP.md. The lifetime parser is now shared with cache.lifetime. One stdout line an hour reports hits, misses, entries and bytes held.

Spec: docs/superpowers/specs/2026-09-10-api-cache-design.md. Plan: docs/superpowers/plans/2026-09-10-api-cache.md.

Closes #8

retargeted from fix/escape-templates to main: !7 merged

2026-09-11 15:13 UTC