Cache Service
The cache service provides high-performance in-memory data storage using Redis. Perfect for session storage, temporary data, and performance optimization.Service Management
Start Cache Service
Stop Cache Service
Check Cache Status
Component Management
Add Cache to Project
Remove Cache from Project
Get Cache Information
Service Configuration
Default Settings
- Port:
6379
- Host:
localhost
- Container:
localcloud-redis
- Max Memory:
256MB
- Memory Policy:
allkeys-lru
(evict least recently used) - Persistence: Disabled (in-memory only)
Connection Details
Basic Usage Examples
Connect to Cache
Basic Cache Operations
Once connected to redis-cli:Cache with Expiration
Application Integration
Python Example
Node.js Example
Go Example
Monitoring and Debugging
View Cache Logs
Check Memory Usage
Performance Monitoring
Common Use Cases
Session Storage
API Response Caching
Rate Limiting
Configuration Options
Update Cache Settings
Available Configurations
Troubleshooting
Cache Service Won’t Start
- Check if port is available:
lsof -i :6379
- Check Docker status:
lc doctor
- View logs:
lc logs cache
- Restart service:
lc restart cache
Connection Refused
- Ensure service is running:
lc status
- Check correct port:
6379
for cache - Verify in same network:
lc ps
Memory Issues
- Increase max memory in config
- Check memory policy:
allkeys-lru
- Clear unnecessary keys:
FLUSHALL
- Monitor memory:
lc exec cache redis-cli info memory
Related Commands
lc start cache
- Start cache servicelc stop cache
- Stop cache servicelc logs cache
- View cache logslc component add cache
- Add cache componentlc status
- Check service status