System Analytics Dashboard Caching System
General
For Super Administrators
System Features
Last updated: June 20, 2025
Version: 1.0
System Analytics Dashboard Caching System
Learn about the caching system used by the analytics dashboards in the Shifts platform, how it works, and how to manage it.
Overview of the Analytics Caching System
The Shifts platform uses a sophisticated caching system for analytics dashboards to ensure high performance while processing large volumes of data:
- Real-time data is cached to reduce database load
- Cached results are stored in Redis for fast retrieval
- Cache invalidation is automatic when relevant data changes
- Background jobs update cache on a scheduled basis
How the Analytics Cache Works
Cache Generation
- When an analytics dashboard is first accessed, the system checks if a valid cache exists
- If no cache exists, or if it has expired, the system:
- Logs the cache miss
- Generates the data through database queries
- Stores the results in Redis cache
- Returns the data to the user
- A timestamp and version identifier are attached to each cache entry
Cache Retrieval
- When a user accesses an analytics dashboard, the system first checks for:
- A valid cache entry
- Cache freshness (within TTL window)
- User permission match
- If a valid cache exists, data is returned directly from the cache
- This typically reduces response time from seconds to milliseconds
Cache Invalidation
Several mechanisms ensure cache data remains fresh:
- Time-based expiration: Cache entries expire after a configurable time period
- Event-based invalidation: Certain actions trigger cache invalidation
- Manual refresh: Administrators can force cache refresh
- Scheduled updates: Background jobs refresh cache during off-peak hours
Cache Configuration Options
System administrators can configure the following caching parameters:
Parameter Description Default Value TTL Time-to-live for cache entries 3 hours Refresh Schedule When background refresh jobs run 2:00 AM daily Max Cache Size Maximum memory allocation per dashboard 50 MB Force Refresh Whether to override cache on manual refresh True Cache Levels Which aggregation levels to cache AllManaging the Cache
Viewing Cache Status
- Go to the System Admin dashboard
- Navigate to “System Settings” > “Performance”
- Select the “Analytics Cache” tab
- View metrics such as:
- Cache hit rate
- Memory usage
- Average query time
- Cache creation timestamps
Manual Cache Operations
Administrators can perform these manual operations:
- Clear Cache: Remove all cached analytics data
- Refresh Cache: Force regeneration of all cache entries
- Optimize Cache: Remove unused or redundant cache entries
- Prioritize Cache: Define which dashboards should be cached first
Troubleshooting Cache Issues
If analytics dashboards are slow or showing outdated data:
- Check the cache status page for errors
- Verify Redis server is functioning properly
- Look for failed background jobs in the job queue
- Check system logs for cache-related errors
- Consider forcing a cache refresh
Best Practices
For optimal analytics cache performance:
- Schedule intensive cache refreshes during off-peak hours
- Monitor cache hit rates to optimize TTL settings
- Increase cache memory allocation for frequently used dashboards
- Use tiered caching for different aggregation levels
- Implement gradual cache warming for critical dashboards
This article should be updated when:
- The caching architecture changes
- New cache configurations are added
- Cache invalidation triggers are modified
- The dashboard performance characteristics change