The cache component

The cache component


Many of the features of this platform is enabled by the local cache component. It is the component that handles most of the communication with the server. It does currently not handle all communications as it lacks the features for specific requests.

When data is requested, the component first search it's local store before contacting the server. Depending on the nature of the request, it may decide that server contact is not necessary and returns data from the local store only. If some data is found locally it may ask the server for more before responding to the request. This method keeps server load as low as possible while also making the system respond quicker to requests. When a record is updated on the server a short message is dispatched to all it's clients, if a client has this record in it's store it will be flagged as outdated, though it will only be refreshed when requested. This way the cache component knows which data is up to date.

When the cache object spots a 401 (unauthorized) response, it automatically flush all data to reduce the chance that it falls into unauthorized hands. This response is received if your session in the server times out due to inactivity.

The cache component also has some functionality around realtime updates, though this is a bit outdated currently. If a data view is active and display a record that is flagged as updated by the server, then the cache component attempts to update the data view.

Kommentarer

Populära inlägg i den här bloggen

The form component

The data grid component