SwiftMemCache alternatives and similar libraries
Based on the "Utility" category
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of SwiftMemCache or a related project?
SwiftMemCache - A Swift Memory Cache
CI Build State
This project contains a Swift class that acts as a memory cache (singleton). It supports optionally namespacing for the cache identifier. It also supports a TTL to invalidate a cashed data object after a certain time.
The purpose of this class is to provide data across the whole code structure with an easy access pattern. You can extract interesting data into the mem cache and access it via a shared instance from anywhere in your code. SwiftMemCache DOES NOT write data to disk!
SwiftMemCache is completely unit tested, to prove that everything works as expected!
NEW: Persistence Feature - Works only for elemental values at the moment
Save the current cache to disk. Entries with an expired TTL will be deleted before the cache gets persisted.
Adds or changes a specified entry in the mem cache. Default TTL: -1 (object will always live in memory)
CTMemCache.sharedInstance.set("foo", data:<YourObject>, namespace:"bar", ttl:3600)
Return an entry if exists, otherwise returns
Deletes an entry by its key (namespace)
Returns true if an entry with the given key (optional namespace) exists
Returns the amount of the entries in the mem cache
Deletes all entries of the given namespace from the mem cache
Checks if an given entry is expired. Returns true/false
Delete Outdated Entries (TTL expired)
Cleans all entries in the mem cache where the TTL is expire
This wipes all the data from the mem cache:
For feature requests or bugs open an issue or provide a unit tested Pull Request :-) Find me on Twitter: @ctews