Number of audio nodes in memory can grow without bound. Allow app to specify maximum number and implement a LRU strategy.
Can impl using doubly-linked list, hash, and hash/list size count where hash tracks cache key -> pointer to node and where head of list is most recently used, tail is least recently used. Use / reuse means moving a node to the head of the list, O(1). When the cache size grows larger than the desired, the tail is popped off, O(1). Look-up is O(1) in the map.
Serialization requires a O(N) walk over the list storing all keys and node data in an ordered array. Unserialization requires rebuilding the linked list, map, and total count from the array.
Not clear what should be tracked for deletion or how using the technique above.
_speechFiles is the only data persisted. This is what should be tracked. When an item in that cache becomes stale, it should also cause the removal of the item from _speechCache.
_soundCache should probably go away entirely. We're not caching real audio nodes anymore.
Issue #14, cleanup cache serialize / unserialize logic
Issue #14, lru cache component plus unit tests
Issue #14, integrate lru tracking
* Remove sound object cache
* Remove speech object cache
* Load/save lru cache in local storage
* Existing tests seem ok, but needs more testing
Issue #14, persist test with fixes
* Fix read from cache
* Update lru info on hit in cache
* Fix cache cleanup
* Better test cleanup
Issue #14, expose and doc cacheSize parameter
Issue #14, updated cache strategy doc