Please note that this page content requires M-Files server 20.5 or higher.
Please note that this page content refers to a pre-release version of software. Please read the information below thoroughly for more information.
The approach shown below is only compatible with version 2.2(and higher) of the Vault Application Framework, where the target audience runs M-Files Online 20.5 or higher.
In general in-memory state (e.g. cached lists of content) should be avoided, as it’s easy to have situations where the cache on one server has different data to the cache on another server. However, there are some situations where this may be required. This can be achieved in a number of ways, but the recommended best practice is the use of named value storage.
It should be noted that this storage pattern should not be used for data that must always be current, as there is a possibility of a race condition when reading and writing data using multiple servers.
This can cause the data fetched from named value storage to become stale, between the time the fetch response is resolved on the server and the time that response is returned to the requestor. Though the window of time for that is small and would be updated in a subsequent fetch request, it should still be considered when designing your solution.
This is the preferred means of persisting data like such a configuration setting or task processing history that may be shown in a UI dashboard. Taking this precaution into account, if a tolerance of being out of date due to the potential for a race condition is acceptable, the usage of the
SharedSettingsHelper is recommended.