tencent cloud

Tencent Cloud Super App as a Service

Cache Management

Download
Focus Mode
Font Size
Last updated: 2026-01-29 09:34:29
During the use of mini programs, the following cache data is generated:
Mini program code cache: When a mini program is opened for the first time, its code is downloaded and cached for quicker access in the future. This data is shared across all accounts and is not isolated by account.
Mini program data cache: This refers to the files and data cached during the use of the mini program. This data is stored separately for each account.
To facilitate the superapp to manage mini program cache, the SDK provides the following capabilities.

Get the data cache size of a specified mini program

/**
* Get the data cache size of a specified mini program (under all accounts and in all versions)
* @param appId Mini program appid
* @return Size in bytes
*/
Future<int> getMiniAppCacheSizeForAllUser(String appId)

Get the code cache size of a specified mini program


/**
* Get the code package size of a specified mini program (under all accounts and in all versions)
* @param appId Mini program appid
* @return Size in bytes
*/
Future<int> getMiniAppPkgSizeForAllUser(String appId)

Delete the data cache of a specified mini program

/**
* Delete the data cache of a specified mini program (under all accounts and in all versions)
* @param appId
*/
Future<void> clearMiniAppCacheForAllUser(String appId)

Delete the code cache of a specified mini program

/**
* Delete the code package of a specified mini program (under all accounts and in all versions)
* @param appId Mini program appid
*/
Future<void> clearMiniAppPkgForAllUser(String appId)

Delete the data and code cache of a specified mini program

/**
* Delete the cache and code package of a specified mini program (under all accounts and in all versions)
* @param appId
*/
Future<void> deleteMiniAppForAllUser(String appId)



Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback