每个小红书小程序都可以有自己的本地缓存,可以通过 xhs.setStorage/xhs.setStorageSync、xhs.getStorage/xhs.getStorageSync、xhs.clearStorage/xhs.clearStorageSync,xhs.removeStorage/xhs.removeStorageSync 对本地缓存进行读写和清理。
storage 同一台设备上,A 用户无法读取到 B 用户的数据;不同小程序之间也无法互相读写数据。
本地缓存的清理时机跟代码包一样,只有在代码包被清理的时候本地缓存才会被清理。