Redis and Caching
2 min read
Updated 1 month ago
Caching Services
Ploi Cloud supports both Redis and Valkey for in-memory caching and session storage.
Redis vs Valkey
- Redis: In-memory data structure store
- Valkey: High-performance key-value store with full Redis compatibility
Adding a Cache Service
- Navigate to your application's overview
- Find the "Cache" card
- Click "Create" to add your first cache service (or "Add cache" if you already have services)
- Select Redis or Valkey as the cache type
- Configure resources using the CPU slider
- Set storage size for data persistence (cannot be changed after creation)
- Optionally select a specific version or leave blank for latest
Laravel Configuration
For Laravel applications, the following environment variables are automatically injected:
Redis
REDIS_URL
- Full connection URL with authenticationREDIS_HOST
- Redis hostnameREDIS_PORT
- Redis portREDIS_PASSWORD
- Redis password
Valkey
VALKEY_URL
- Full connection URL with authenticationVALKEY_HOST
- Valkey hostnameVALKEY_PORT
- Valkey portVALKEY_PASSWORD
- Valkey password
Update your Laravel cache configuration to use these variables:
CACHE_DRIVER=redis
SESSION_DRIVER=redis
Resource Configuration
When creating a cache service, you can configure:
- CPU: Adjustable via slider (from 0.25 to multiple cores)
- Memory: Configurable based on your needs
- Storage: Persistent volume for data (e.g., "8Gi", "10Gi")
Service Management
Manage your cache service through the application dashboard:
- View service logs for troubleshooting
- Restart the service when needed
- Enable temporary debug access for direct connections
- Monitor service status (active, stopped, failed)
- Edit resources to scale up or down