-
Notifications
You must be signed in to change notification settings - Fork 0
Cache Domain
jake-chromatir edited this page Aug 9, 2026
·
2 revisions
File-based cache with TTL expiration for faster repeated queries.
magmascript cache statsOutput:
total_files total_size_bytes domains enabled hits misses sets hit_rate
----------- ---------------- ------------------------------------------ ------- ---- ------ ---- --------
3 12456 {'media': {'files': 1, 'size_bytes': 3259}} True 5 2 3 71.4%
magmascript cache clearmagmascript cache clear --domain media
magmascript cache clear --domain scores
magmascript cache clear --domain gh| Domain | TTL | What |
|---|---|---|
| Media | 24h | Full search results (all 6 providers) |
| Scores | 1h | Score file reads from Pi |
| GitHub | 5min | Workflow runs (rate limit protection) |
magmascript media search "art" --no-cache
magmascript scores list --no-cache
magmascript gh workflows --no-cache[cache]
enabled = true
ttl_media = 86400 # 24h
ttl_scores = 3600 # 1h
ttl_gh = 300 # 5minOr disable entirely:
export MAGMA_CACHE_DISABLED=1Cache files are stored in ~/.cache/magmascript/{domain}/:
~/.cache/magmascript/
├── media/
│ └── {hash}.json # keyed by query+source+page+filters
├── scores/
│ └── {game_id}.json # keyed by game
└── gh/
└── workflows.json # single file, TTL-based