Storage APIs

clearStorage

Clear all local data cache.

Overview

my.clearStorage clears the local data cache. This is an asynchronous interface. Clearing the webview embedded storage data will not clear the storage data of the Mini Program.

Sample Code

my.clearStorage();

Usage Notes

  • This is an asynchronous interface
  • Storage is isolated between embedded webview and Mini Program
  • Clearing embedded webview storage does not affect Mini Program storage
  • This operation removes all cached data and cannot be undone
  • Use with caution as it removes all stored key-value pairs