The dragonJSON cache is managed automatically through mutation responses — when your server returnsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/michael-tiger-2010/dragonjson/llms.txt
Use this file to discover all available pages before exploring further.
{ invalidate: [...] }, the affected paths are marked stale and re-fetched on next access. These three methods let you inspect and control the cache explicitly when you need finer-grained control.
$refresh()
Manually mark a path as stale and trigger a re-fetch on next access. Signature:$refresh() → Promise<Proxy>
When called on an object-valued path, dragonJSON replaces the cached entry with a { __next: true } stub — the lightweight sentinel that signals “needs fetching”. When called on a primitive-valued path, it immediately re-fetches and overwrites the cached value. In both cases, $on listeners registered at the path are fired with initiator: "refresh".
$refresh returns a Proxy to the refreshed path so you can chain directly into a read if needed.
$loaded()
Check whether a path is fully present in the local cache without making any network request. Signature:$loaded() → Promise<boolean>
$loaded walks rootData along the full path. It returns:
true— every segment exists in the cache and none is a__nextplaceholder stubfalse— any segment is missing,undefined, or is still a__nextstub
$loaded.
$exists()
Check whether a path exists on the server, fetching it if not already cached. Signature:$exists() → Promise<boolean>
Unlike $loaded, $exists will make a network request if the path is not cached. It resolves to:
true— the path fetched successfully and returned a valuefalse— the fetch threw an error or the path resolved toundefined
$exists never throws — the promise always resolves to a boolean.
__more: true, meaning child keys are not known in advance and each key must be probed individually.
control.debug.getCache()
Dump the entire in-memoryrootData cache tree to the console.
When debug: true is active, control.debug.getCache() passes the full rootData object to logFunc (defaulting to console.log). This lets you inspect exactly what dragonJSON has cached at any point without adding your own instrumentation.
control.debug.getCache() only produces output when debug: true is active. If debug mode is off, the call is a no-op.