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

Struct ImageCachePreference

sealed struct ImageCachePreference
Types of caching strategy for image load requests. Each value controls whether the cache is consulted, whether TTL expiration (configured via IImageCacheManager::setDefaultExpiration) is respected, and whether a network fetch is attempted on cache miss.

Fields

Constants

DEFAULT

ImageCachePreference = {0}
Cache-first with TTL. The IImageLoadRequest is fulfilled from cache if a fresh (non-expired) entry exists. Expired entries are discarded and data is loaded from the originating source. On cache miss, data is loaded from the originating source. TTL is determined by IImageCacheManager::setDefaultExpiration. HTTP response cache headers are NOT consulted; see ImageCachePreference::WEB for HTTP-header-based caching.

RELOAD

ImageCachePreference = {1}
Network-only. Existing cache data is bypassed entirely — the cache is neither read nor consulted for freshness. Data is always loaded from the originating source.

ONLY_CACHE

ImageCachePreference = {2}
Cache-only with TTL. A fresh (non-expired) cached entry is used to fulfill the IImageLoadRequest. Expired entries are discarded. On cache miss or expiration, no network fetch is attempted and the load is considered failed. TTL is determined by IImageCacheManager::setDefaultExpiration.

WEB

ImageCachePreference = {3}
HTTP-standard caching. The IImageLoadRequest follows standard HTTP caching procedures: HTTP response cache headers from the originating source determine caching duration. A cached entry is used if fresh per those headers. If the cached entry has expired or there is a cache miss, data is loaded from the originating source. Unlike ImageCachePreference::DEFAULT, expiration is governed by HTTP headers rather than IImageCacheManager::setDefaultExpiration.

DEFAULT_NO_TTL

ImageCachePreference = {4}
Like ImageCachePreference::DEFAULT, but TTL is ignored. Any cached entry — fresh or expired — is returned immediately without checking expiration. On cache miss, data is loaded from the originating source.

ONLY_CACHE_NO_TTL

ImageCachePreference = {5}
Like ImageCachePreference::ONLY_CACHE, but TTL is ignored. Any cached entry — fresh or expired — is returned immediately without checking expiration. On cache miss, no network fetch is attempted and the load is considered failed.
Last modified on October 29, 2026