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
We have a "clear cache" setting in our app, and when the user taps it we call apollo.store.clearCache(..) which succeeds, but the underlying sqlite file stays exactly the same size and is not removed. I tried to just delete the file after the success callback, but the store never re-creates it.
Is this a bug with clearCache function or am I doing something wrong?
Hi @avielg - I suspect the file size behaviour is due to the internals of sqlite; have you tried setting the shouldVacuumOnClear property in SQLiteNormalizedCache.init to true? By default it is false and when configured with true the vacuum command will be run whenever the sqlite cache is cleared. It seems that without forcing that behaviour sqlite is left to decide when to recover disk space which may not be immediately after deleting the records.
As for the file not being removed; we never remove the db file. It's created at startup if it doesn't exist but we have no code to delete the file.
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.
Summary
We have a "clear cache" setting in our app, and when the user taps it we call
apollo.store.clearCache(..)
which succeeds, but the underlying sqlite file stays exactly the same size and is not removed. I tried to just delete the file after the success callback, but the store never re-creates it.Is this a bug with clearCache function or am I doing something wrong?
Thank you!
Version
1.10.0
Steps to reproduce the behavior
Create a store like so:
Try to clear cache:
Logs
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: