You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yup - makes sense - would love a PR for this. I mostly used count in my initial implementation because the items I am storing in my app are all the same size...
Have a single _size entry (similar to _lru) that gets updated every time an entry is added/removed. This would add ~50% of the number of backend calls when adding/removing items because of having to get/set _size as well as _lru. When removing the item we will also have to backend.getItem the value (as well as backend.removeItem) in order to update _size.
Track the _size and _lru in a single _metadata entry (e.g. metadata = { size: 0, lru = [[key1], [size1]] }). This requires more code changes, but I think it would result in a better implementation. When removing key1 we could just subtract size1 from the current size.
Constrains in mobile phones are mostly related to storage. Discuss Create policy based on size X bytes (GB, MB, KB) ...
The text was updated successfully, but these errors were encountered: