cache subcommand provides operations for inspecting and managing the local cache of API responses. Caching improves performance by avoiding redundant API calls.
Cache Location
By default, the cache is stored in:Commands
status
Show cache statistics including path, file count, size, and registry information.- Path — Cache directory location
- Files — Total number of cached files
- Size — Total cache size in MB
- Endpoints — Breakdown of files by endpoint type (indicators, archives)
- Geos registry — Cached geography mappings (geo_id → geo_name)
- Indicator catalog — Number of indicators in the offline catalog
path
Print the cache directory path. Useful for scripting or manual inspection.clear
Remove cached files. You can clear the entire cache, a specific endpoint, or a specific indicator/archive.--indicator, -i INTEGER— Clear a specific indicator/archive ID--endpoint, -e TEXT— Endpoint to clear:indicators,archives(default:indicators)--all, -a— Clear entire cache including geos and catalogs (flag)
--indicator <ID>— All cached responses for that specific ID--endpoint indicators— All indicator cache files (keeps archives and registries)--endpoint archives— All archive cache files (keeps indicators and registries)--all— Everything (indicators, archives, geos, catalogs)
geos
Show the global geography registry (geo_id → geo_name mappings).Cache Behavior
Automatic Caching
All API responses are automatically cached:Cache Keys
Cache keys include all relevant parameters:- Indicator/archive ID
- Date range
- Geography filters
Cache Expiration
Currently, cached files do not expire automatically. You must manually clear stale cache entries:Common Workflows
Inspect Cache Before Clearing
Selective Cache Management
Refresh Stale Data
Debugging Cache Issues
Free Disk Space
Performance Benefits
Caching significantly improves performance:| Operation | Without Cache | With Cache |
|---|---|---|
| Indicator history (1 month) | ~2-3s | ~50ms |
| Archive download (1 file) | ~5-10s | ~100ms |
| Multiple queries | Linear growth | Near-instant |
- Let cache grow naturally — Don’t clear unless necessary
- Clear selectively — Use
--indicatorto target specific IDs - Monitor size — Use
esios cache statusperiodically - Clear all when debugging — Use
--allto rule out cache issues
Geos Registry
The geos registry provides fast geography name resolution without API calls:3→España8001→Portugal8741→France- etc.
Troubleshooting
Cache Not Working
Stale Data
Disk Space Issues
See Also
- Indicators — Commands that use the cache
- Archives — Archive caching behavior
- Config — Configure cache location (future)
