Context
ChessComClient.getCacheable (and therefore get, which is a thin wrapper) unconditionally persists every 200 response to api_response_cache + api_response_body. For endpoints that are fetched once and never revisited, this is pure storage cost with no payoff.
Motivating example
Ancient finished matches from a sequential ID scan would each get a cache row. At ~1.93M match IDs and most of them cold, the cache bloat would be substantial and unrecoverable.
Options
- Explicit opt-out parameter on the client API — e.g.
getCacheable[T](url, cache = false).
- URL-pattern opt-out list — configured regex/prefixes that skip the cache write.
- Automatic decision based on
Cache-Control: max-age — Chess.com's values are binary 5s / 3600s. Only caching max-age >= 3600 would skip ephemeral payloads; could over-skip for one-shot contexts that also return 3600s.
Related
Context
ChessComClient.getCacheable(and thereforeget, which is a thin wrapper) unconditionally persists every 200 response toapi_response_cache+api_response_body. For endpoints that are fetched once and never revisited, this is pure storage cost with no payoff.Motivating example
Ancient finished matches from a sequential ID scan would each get a cache row. At ~1.93M match IDs and most of them cold, the cache bloat would be substantial and unrecoverable.
Options
getCacheable[T](url, cache = false).Cache-Control: max-age— Chess.com's values are binary 5s / 3600s. Only cachingmax-age >= 3600would skip ephemeral payloads; could over-skip for one-shot contexts that also return 3600s.Related
ApiResponseCache.deleteBeforecleanup runs on startup; that's reactive. This is about preventing unneeded writes in the first place.