Related
- CLI System Commands - System operations from CLI
What You’ll Learn
- How to view cache statistics
- How to clear execution cache
- How to optimize cache usage
- How to monitor cache performance
- Best practices for cache management
Cache Management Overview
| Operation | SDK Method | API Endpoint |
|---|---|---|
| Statistics | sandbox.cache.stats() | GET /cache/stats |
| Clearing | sandbox.cache.clear() | POST /cache/clear |
Core Concepts
Cache Statistics
View cache statistics including hit rate and cached items.- Cache Statistics - View cache statistics
- SDK: Python: sandbox.cache.stats() | JavaScript: sandbox.cache.stats()
- API: GET /cache/stats
Clearing Cache
Clear execution cache to free memory or force re-execution.- Clearing Cache - Clear execution cache
- SDK: Python: sandbox.cache.clear() | JavaScript: sandbox.cache.clear()
- API: POST /cache/clear
SDK Reference
Python SDK
Complete reference for Python cache operations.- Cache Module - Complete cache API
cache.stats()- Get cache statisticscache.clear()- Clear cache
JavaScript SDK
Complete reference for JavaScript/TypeScript cache operations.- Cache Module - Complete cache API
cache.stats()- Get cache statisticscache.clear()- Clear cache
API Reference
VM Agent API
REST API endpoints for cache management.- VM Agent API Overview - API overview
- Get Cache Statistics -
GET /cache/stats- Get cache stats - Clear Cache -
POST /cache/clear- Clear cache
Quick Start
If you’re new to cache management, start here:- Cache Statistics - View cache performance
- Clearing Cache - Clear cache when needed
Related Topics
- Code Execution - Cache affects code execution
- Observability - Monitor cache metrics
- Sandboxes - Cache persists across state changes
Next Steps
- Learn about Cache Statistics for monitoring
- Explore Clearing Cache for optimization
- Review Code Execution to understand cache impact
- Check out Observability for performance monitoring

