Caching

Our SDK has a number of caches ensuring they are fetched from Sports API and are properly cached in order to minimize network-related delays and network traffic. Some caches are populated/updated automatically by the SDK whereas others are populated with data requested by the SDK users. The caches which are populated with data requested by the user also allow purging specific cached items (by providing the id of the cached item). User can review SportDataProvider and available methods for deleting cache items.

SDK saves the data received from API in different caches:

Sport Event Cache

used to cache all short (e.g. match) and long-term (e.g. season, tournament) sport events.

The cache is partially populated automatically. SDK maintains a sliding window of 3 days worth of sport events in SportEventCache. It does this by initially requesting sport event for three subsequent days and after that, fetching one additionla day on a daily basis. The cache is also populated with data requested by the code using the SDK (responses to summary.xml, fixture.xml, schedule.xml, etc)

When a "FixtureChange" message is received by the SDK, the associated sport event is purged from the cache.

Sport Data Cache

used to cache category and sports data. The cache is partially populated automatically. At the start, tournaments.xml, sports.xml, and lotteries.xml API endpoints are automatically fetched. After that, every 12 hours, endpoints are re-fetched and merged into the cache.

On the same period, it purges all sport events from the sport event cache which has 'ScheduleEnd = now-12h'. Any new sport or category received from other endpoints is also cached.

Sport Event Status Cache

used to cache sport event status. The cache is populated with sport_event_status from odds_change messages and from the summary.xml endpoint when the requested item is not found in the cache. SportEventStatus from feed message has precedence over SportEventStatus data from API.

Invariant Markets Descriptions Cache

used to cache market descriptions of invariant (not having the "variant" specifier) markets. The cache is populated / updated automatically every 6 hours.

Variant Markets Description Cache

used to cache static/predefined market descriptions of variant (having a "variant" specifier) markets.

Variant Descriptions Cache

used to cache descriptions of variant markets which cannot be prefetched. The cache is populated with data requested by code using the SDK.

Profile Cache

used to cache player & competitor profiles. The cache is populated with data requested by code using the SDK.

Expiration Period
On-demand Purge

Sport Event Cache

12 hrs

Supported; by providing the id of the item to be purged.

Sport Data Cache

Never

Not Supported

Sport Event Status Cache

5 mins

Supported indirectly; the status is purged when the associated sport event is purged from the sport event cache.

Invariant Markets Descriptions Cache

Never

Not supported

Variant Markets Description Cache

Never

Not Supported

Variant Descriptions Cache

3 hrs

Supported; via MarketDescriptionManager

Profile Cache

24 hrs

Supported; by providing the id of the item to be purged.

Last updated

Was this helpful?