### Cache

The cache can be configured in three possible ways:

1. portal: Persistent data is cached on the portal server. This makes the back-end stateless and does not allow using the setCache and getCache methods. The required data will be sent to the back-end on each request, increasing network traffic. Files saved in the session folder will be deleted at the end of each call.

2. file: Enables file-based caching on the back-end server. The cache location can be configured by setting an environment variable SIMIAN_TEMP_FOLDER on the back-end to the path of a folder where the back-end (worker) has read and write access. If the environment variable is left unset, depending on the platform, a default location in the user data is used (e.g. %userprofile% or \$HOME). Please note that on a server with multiple workers, the cache location must be shared between those workers to ensure that all workers have the same state.

3. redis: Caches the data in a Redis database. The configuration of the redis cache is different for the various back-end servers.

• MATLAB Production Server: Caching with redis can be configured in the MATLAB Production Server dashboard. After that, only one setting is required in the configuration:

• connection_name Redis connection name as configured on the MATLAB Production Server.
• Python back-ends: The Python back-ends can be configured to connect to redis using the PyPi redis package. To connect, at least the following fields need to be specified:

• host Host name of the redis server.

• port Port on which the redis server runs.