Skip to content

Conversation

vazarkevych
Copy link
Collaborator

Swift-like Cache Implementation Changes
Enhanced InMemoryFeatureCache with Swift CachingManager pattern:
• Added SetCacheKey(string key) - Creates SHA256 hash-based cache directories (first 5
characters)
• Added SetCustomCachePath(string path) - Allows custom cache directory configuration• Added
ClearCache() - Clears both file system and in-memory cached data
• Implemented file-based persistence - Features stored as JSON files with automatic directory
creation
• Added thread-safe file operations - All cache operations protected with locks
Context simplified:
• Added CachePath property for cache directory configuration
• Removed complex cache configuration options
Integration updated:
• GrowthBook now configures cache key from ClientKey and custom path from Context.CachePath
• Maintains backward compatibility while adding persistent caching
Result: Single-file modification transforming in-memory cache to Swift-like persistent cache
without additional complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant