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
Can you please clarify in the documentation - if flushExpired() is never called, will the expired data just sit there in the database, or will something else eventually flush it?
#57
Open
psmartt opened this issue
Jun 21, 2016
· 2 comments
From what I can see, there is no automatic, periodic, randomised or sampled call to flushExpired().
However, two clean up strategies exist:
When trying to retrieve a key of which the value is expired, it'll be removed on-demand.
When setting a key and the 5-10MB storage quota is full, the library will remove values (starting with the oldest) to free up the required space.
It may be useful to add something like if (Math.random() < 0.2) { requestIdleCallback( lscache.flushExpired ); } to your page to periodically trigger a clean up on 1/5 page views.
No description provided.
The text was updated successfully, but these errors were encountered: