AssetCache

interface AssetCache

Interface of the cache of advertising resources.

You can get an object of this interface in AdRenderer.ServiceLocator when creating a custom renderer. It can be used to create custom logic for caching advertising resources.

Note: In most cases, you will only need to use AssetRepository for your custom renderer.

An example of a situation where you would want to implement your own caching logic would be HTML ads, where you would want to store all the resources used by web view in one folder and use it as a base URL.

An example of how to work with the cache can be found in our tutorials.

See also

Functions

Link copied to clipboard
abstract suspend fun read(path: AssetPath): AdResult<Pair<ByteArray, URI>?>

Reads data from the cache based on the passed AssetPath.

Link copied to clipboard
abstract suspend fun remove(path: AssetPath): AdResult<Unit>

Removes data from the cache on the passed AssetPath.

Link copied to clipboard
abstract suspend fun write(path: AssetPath, data: ByteArray): AdResult<URI>

Writes the passed data to the cache along the passed AssetPath.