pamelafox / lscache

A localStorage-based memcache-inspired client-side caching library.
Other
1.46k stars 160 forks source link

Expiration sorting bug? #2

Closed fiveminuteargument closed 13 years ago

fiveminuteargument commented 13 years ago

This is a tiny change which I haven't actually tested, so I hope it's not a problem. But I think that's definitely a bug, reading the code.

pamelafox commented 13 years ago

Thanks for noticing -- I realized that code also needs to store the key after removing the old items, since it fails to at first, committed this: https://github.com/pamelafox/lscache/commit/3b41b417024c55a56ca12cc4069bf2c94dda2891 It could still be over quota if the deleted items are small and the added item is large, but I think that is very much an edge case. Feel free to send other pull requests my way if you come up with other improvements. Thanks!