Cleaning up indexedDB of speckle viewer / objectloader

Hello Speckle folks! :slight_smile:

Is there a built-in mechanism, option or function in the speckle viewer or object-loader to clean up the browser’s local objects database? It seems that the object-loader (implemented in the viewer) is just adding and adding objects and the cleanup is left to the browser.

Since models can get big I‘d like to keep that somehow under control (when necessary). :police_car: :smiley:

Thanks in advance! :slight_smile:

1 Like

Heya, there’s no object-loader specific mechanism to do so, as theoretically it’s the browser’s responsability to manage storage. Theoretically, they get cleaned up either after a certain inactivity time or when your disk space is running low, so theoretically we don’t and shouldn’t care.

Practically, that might not happen. I’m curious as to the context in which you want to keep that under control - is this a custom app, or our frontend?

Removing the db should be as easy as indexedDB.deleteDatabase('speckle-object-cache')

2 Likes

Hey @dimitrie ,

Thanks!

OK, I understand and agree. So I just have to figure out a good moment then and do that manually, that’s fine. :slight_smile:

Indeed, I’m building a web app for editing model parameters, which also includes a small viewer. But the app might load multiple models during the use of that app (but just one at a time). And although it’s basically just loading changed objects it might still add up …

1 Like