NSCache's eviction strategy is not defined and it's not LRU, which can impact performance when handling memory caching.
Many developers opt to create their own LRU cache implementation like LRUCache using a Swift Dictionary with a linked list to control memory consumption effectively.
When dealing with custom LRU cache implementations, it's important to manage memory allocation carefully to prevent issues like stack overflow caused by automatic deallocation of linked list nodes.
To ensure objects are retained in the cache even when the app is backgrounded, developers can implement the NSDiscardableContent protocol within the objects stored in the cache.