Motivation
Follow-up API addition requested after the Resolver Specific Parameters (ID5 Mobile In-App) work (#39). These changes should come after that release ships, and get their own release.
Cached targeting data currently persists in local storage indefinitely - targetingFromCache() keeps returning it until it is overwritten by a new targeting call or cleared explicitly, so arbitrarily stale data can be served.
Details
The targeting cache should have a configurable TTL that defaults to 24 hours.
Objective
- Add a cache TTL setting to the SDK configuration, defaulting to 24 hours.
- Store the fetch timestamp alongside the cached targeting data.
targetingFromCache() treats an entry older than the TTL as absent (returns null) and clears it from storage.
- Unit test coverage for TTL expiry and the default value.
- Document the new option.
Motivation
Follow-up API addition requested after the Resolver Specific Parameters (ID5 Mobile In-App) work (#39). These changes should come after that release ships, and get their own release.
Cached targeting data currently persists in local storage indefinitely -
targetingFromCache()keeps returning it until it is overwritten by a new targeting call or cleared explicitly, so arbitrarily stale data can be served.Details
The targeting cache should have a configurable TTL that defaults to 24 hours.
Objective
targetingFromCache()treats an entry older than the TTL as absent (returns null) and clears it from storage.