Interface IImageCacheManager
interface IImageCacheManager
Extends com.amazon.apmf.IStandard
Interface for managing an Image cache.
Methods
clear()
Purges the cache based on thevoidclear(CacheType*cacheType)
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()
Sets the default expiration time for the image cache.voidsetDefaultExpiration(com.amazon.apmf.MonotonicDurationduration)
Parameters
duration
com.amazon.apmf.MonotonicDuration — Required
Default expiration time value in seconds.
setSize()
Sets the cache size in bytes for a specificvoidsetSize(CacheType*cacheType,u32cacheSize)
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()
Gets the collection ofCacheType[]getStatus(stringuri)
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.

