Forum Stats

  • 3,815,385 Users
  • 2,259,012 Discussions


PouchDB purge best practices using Offline Persistence Toolkit

Mark Ericson
Mark Ericson Member Posts: 1 Green Ribbon

Building a PWA with OPT with PouchDB as PersistenceStore for shredding. What is the best practice to purge/reclaim space for the PouchDB?

The reason I'm asking is that PouchDB does not have the ability to 'purge' deleted objects and there isn't a way to reclaim space for resources that have been stored in PouchDB that are no longer required in the cache.

I believe the only solution to reclaim space is to remove the database and create a new one. If that is the case what is a good practice for doing that? Delete the database after the sync has been completed? Offer user settings to purge the PouchDB persistence storage?


  • The JET Offline Persistence Toolkit (OPT) is not doing anything special with PouchDB. It's the same library that anyone would use. Whatever you can find about it's use in a regular Internet search is going to hold true for it's use with OPT as well.

  • Hi Mark,

    I asked the engineers to take a look at my response to make sure I was correct, and they replied that the OPT code does indeed delete the DB and re-create it when keys are deleted so that we avoid the issue you have mentioned.

    Sorry for my misinformation in the original reply.