Advertise result caching
Caching is opt-in metadata. A scalar function can override CacheControlMetadata; table planning
can return cache lifetime and revalidation information in its plan result.
public IReadOnlyDictionary<string, string>? CacheControlMetadata =>
new Dictionary<string, string>
{
["vgi.cache.ttl"] = "300",
["vgi.cache.per_value"] = "1",
};
Cache identity must include every dependency
Do not mark volatile results reusable. Settings, secrets, attach data, transaction state, time-travel arguments, and external data versions can all affect the result. Advertise caching only when the metadata and protocol identity distinguish those inputs or a validator can detect changes.
The client/engine owns the cache. The worker describes reuse; it does not keep an in-memory result dictionary that every worker process magically shares.