StackResolve logoStackResolve

Caching

Why the 500th call is almost free.

The first call for a company is expensive: it gathers the underlying evidence and runs a model to extract and normalize the facts. Every call after that reads stored facts from the database, so it is fast and nearly free, right up until a field crosses its freshness TTL and gets refreshed on its own.

Text
First call:   gather + extract + normalize   ($)
Later calls:  stored facts                    (~free)
Stale field:  refresh only that field         (partial $)

The cached flag on a research response tells you which case you got. cached: true means every returned field came from storage. cached: false means at least one field was missing or stale and got refreshed on this call.

#One shared fact store

Inside StackResolve, the readiness system and the research primitives share one fact store. Research done anywhere warms the cache for everyone. A tool scored by an audit is already partly populated when you call get_company, and a company you have researched is already partly populated when you audit it.

#Metering and cache

Metering is per call, not per refresh. A metered primitive records one usage event whether the answer came from cache or a fresh gather. Your charge is governed by your plan and the metered event, not by how much work the call did under the hood. See Billing & metering.