This document describes the new cache management features added to the GitLab Component Helper extension.
The extension now provides two distinct cache management operations to give users better control over cached GitLab component data:
- Update Cache - Forces refresh of cached data while preserving cache structure
- Reset Cache - Completely clears all cached data and starts fresh
GitLab CI: Update Cache- Forces fresh fetch of all component data from sourcesGitLab CI: Reset Cache- Completely clears all cached data (with confirmation prompt)GitLab CI: Refresh Components Cache- Existing command for standard refresh
The component browser now includes three action buttons in the header:
- 🔄 Refresh - Standard refresh (reloads current cached data)
- 📥 Update Cache - Forces fresh data fetch from all GitLab sources
- 🗑️ Reset Cache - Completely clears cache (requires confirmation)
updateCache()- Clears internal caches to force fresh fetchresetCache()- Completely clears all cached datagetCacheStats()- Returns detailed cache statistics
updateCache()- Forces refresh and triggers ComponentService updateresetCache()- Clears in-memory and persistent storagegetCacheStats()- Returns comprehensive cache statistics
Use when you want to:
- Fetch the latest component definitions from GitLab
- Refresh cached data without losing cache structure
- Update components after changes are made to GitLab repositories
- Resolve stale data issues
Use when you want to:
- Completely start fresh with component data
- Clear corrupted cache data
- Troubleshoot cache-related issues
- Free up storage space
-
ComponentService Caches:
catalogCache- GitLab catalog API responsescomponentCache- Individual component metadatasourceCache- Source-level component data
-
ComponentCacheManager Caches:
- In-memory component arrays
- Project versions cache
- VS Code global state storage
- Source error tracking
- Progress Indicators: Both operations show progress notifications
- Confirmation Prompts: Reset cache requires user confirmation
- Error Handling: Graceful error handling with user-friendly messages
- Visual Feedback: Browser UI updates to reflect cache state
- Loading States: Clear loading indicators during operations
- Confirmation Required: Reset cache asks for confirmation before proceeding
- Error Recovery: Failed operations don't leave cache in inconsistent state
- Logging: All cache operations are logged for debugging
- Graceful Degradation: Failures fall back to existing cached data when possible
Both cache management features properly handle:
- GitLab API token management
- Rate limiting considerations
- Network error recovery
- Batch processing for large datasets
- Parallel fetching optimizations
The cache management system handles:
- VS Code global state persistence
- Memory-only fallback mode
- Cache size optimization
- Automatic cleanup of expired entries
- Cross-session cache persistence
The cache management features have been tested with:
- Multiple GitLab instances
- Large component datasets
- Network connectivity issues
- Token authentication scenarios
- UI responsiveness during operations
Potential future improvements:
- Selective cache clearing (by source)
- Cache size monitoring and alerts
- Automatic cache optimization
- Cache export/import functionality
- Advanced cache statistics dashboard