Caching

The client service caches multiple types of entities to speed up the processing of requests.

Applications

Most endpoints in the client-service have an app-code in the path which means that they require an app to process the request. The apps are maintained by the push-service and needs to be fetched from there to validate the app-code and to get the data needed.

To make restarts and startups or new pods less expensive the apps are cached in two levels. First level is memory to avoid further network trips when processing a request. The second level is a redis instance.

Note: If an application can’t be found it will be cached in redis with the notFound property set to true. This in order to avoid hitting the push-service every time for a deactivated app still live.

Invalidation

The client-service listens to entity-events emitted by the push-service and removes an app from both caches in case of any change to the application. The TTL of the objects set in redis cache is set to 24h by default but can be overriden by APP_CACHE_TTL_SECONDS in the environment.

Safari Push Packages

Packages maintained by push-service by served by client-service. They are removed from the in-memory cache when the service restarts.

Geo Locations

Are automatically invalidated after 10 minutes by default but can be overriden by the GEOLOCATION_CACHE_TTL_SECONDS in the environment.