A simple but flexible cache library for iOS and watchOS apps, written in Swift with a functional programming approach.
Carlos is a Swift library for building custom cache layers in iOS and watchOS applications. It provides a composable, type-safe system for combining memory, disk, and network caching with transformations and conditional logic. It solves the problem of managing complex caching strategies with clean, functional code.
iOS and watchOS developers who need flexible, type-safe caching solutions beyond simple key-value stores, particularly those building apps with complex data fetching and caching requirements.
Developers choose Carlos for its functional programming approach, which allows for highly composable and type-safe cache pipelines, reducing boilerplate and enabling advanced features like request pooling, conditional caching, and seamless transformations.
A simple but flexible cache
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows combining multiple cache levels like memory, disk, and network into pipelines with automatic fallback, enabling complex strategies as shown in the usage examples.
Supports key and value transformations using OneWayTransformationBox and TwoWayTransformationBox, ensuring compile-time safety when integrating different cache types.
Implements request pooling to group concurrent requests for the same key, avoiding duplicate expensive operations like network fetches, as detailed in the pooling requests section.
Includes ready-to-use memory, disk, network fetcher, and NSUserDefaults caches, speeding up initial setup for common caching needs.
Requires understanding of functional programming patterns like monoidal composition and Swift's type system, which can be daunting for developers not experienced with these concepts.
Only supports iOS 13+ and watchOS 6+ due to the migration to Combine, excluding apps that need to target older operating systems, as stated in the breaking changes section.
Building custom cache pipelines involves multiple steps like key transformations and conditioning, which adds boilerplate compared to simpler caching libraries.