Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IImageCacheManager

interface IImageCacheManager
Extends com.amazon.apmf.IStandard Interface for managing an Image cache.

Methods

clear()

void clear(CacheType* cacheType)
Purges the cache based on the CacheType. This method skips images attached to the foreground window when called with CacheType::MEMORY, to prevent purging images which are currently being displayed.

Parameters

cacheType
CacheType* — Required See CacheType.

setDefaultExpiration()

void setDefaultExpiration(com.amazon.apmf.MonotonicDuration duration)
Sets the default expiration time for the image cache.

Parameters

duration
com.amazon.apmf.MonotonicDuration — Required Default expiration time value in seconds.

setSize()

void setSize(CacheType* cacheType, u32 cacheSize)
Sets the cache size in bytes for a specific CacheType. The requested size is a hint, not a guarantee. Must be called on the UI thread. With CacheType::MEMORY the limit governs eviction, not admission: it is the size the cache evicts down towards, and it is not a cap on memory use. Images are always cached when loaded, even if a single image is larger than the limit, and images currently in use are never evicted. Memory use can therefore exceed the limit, and will keep doing so for as long as the resident images remain in use. Lowering the limit evicts images that are not in use immediately; the rest become eligible for eviction once they are released. Use IImageCacheManager::clear to release memory now. With CacheType::PERSISTENT the limit is recorded but the cache is not pruned. On-disk contents are brought within it by a later eviction pass that runs after a subsequent remote image download, so a reduction may not take effect for some time — and will not take effect at all if the application afterwards loads only bundled or local images. Use IImageCacheManager::clear to reclaim disk space immediately. An individual image larger than the whole limit is not written to disk at all.

Parameters

cacheType
CacheType* — Required See CacheType. Required.
cacheSize
u32 — Required Cache size in bytes.

getStatus()

CacheType[] getStatus(string uri)
Gets the collection of CacheType in which the IImage is present.

Parameters

uri
string — Required URI of the IImage.

Returns

CacheType[] A collection of CacheType in which the IImage is present. If the image is not present in the cache, an empty array is returned.
Last modified on October 29, 2026