l) TyrService Cache

Structure

Each frigg instance has a memory cache with a cache controller. New values are sent to all connected servers per tcp (encrypted serialized objects). The values are grouped by user id. If a function invalidates the cache, the value group is removed on all connected servers. The first new request populates the values for all connected servers again.

This decreases the need to query the database for data that is seldomly changed: more reads then updates. This is the case for polling getSigningRequests for document changes.

At the moment only getSigningRequests is cached. Methods that invalidate the cache can by annotated with "@cache(invalidate=true)", or if the invalidation does not target the logged in user, CacheManager.invalidate(userid) can be used.

Activation and configuration

The tyrservice implementation has to be set to com.stepover.frigg.server.TyrServiceCached. This can not be done for keys with TyrServiceExtended implementation.

UPDATE tyrservice SET implementation = 'com.stepover.frigg.server.TyrServiceCached' WHERE tyrservice_id = 'customer-key';

in the config.ini

config key

example

description

optional

config key

example

description

optional

tyrcache

true

activates the tyrservice cachee

 

tyrcache_port

default 1110

the port the listener listens on

optional

tyrcache_host

host

the host the listener listens on, if not set, all hostnames

optional

tyrcache_servers

host1:1110,host2:1110

a comma seperated list of servers to connect to

 

tyrcache_lifetime

default 300

the lifetime of a cache object in seconds

optional

tyrcache_max_objects

default 10000

the maximum amount of objects stored in the cache before objects get evicted

optional

tyrcache_encryption_key

default value hard coded, should be changed

the key used to encrypt the objects, 32 characters