Skip to content

Configurable TTL for the targeting cache (default 24 hours) #42

Description

@eugenedorfman-optable

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

  1. Add a cache TTL setting to the SDK configuration, defaulting to 24 hours.
  2. Store the fetch timestamp alongside the cached targeting data.
  3. targetingFromCache() treats an entry older than the TTL as absent (returns null) and clears it from storage.
  4. Unit test coverage for TTL expiry and the default value.
  5. Document the new option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions