This article applies to common modules that have Server and Server call properties set to True and the Reuse return values property set to During session.
When export methods declared in the module are called from the client application, return values are cached both on the client and on the server.
During the call, the platform searches the client cache for the return value.
- If the value is found, this value is returned.
- If the value is not found in the client cache, a server call is performed and the platform searches the server cache for the return value.
- If the value is found, this value is returned.
- If the value is not found in the server cache, the module body is executed, the result is stored to the server cache, sent to the client, stored to the client cache, and returned to the call source.
This can introduce data inaccuracies in scenarios where cached objects are changed by the client script. An object is changed in the client cache but it is not changed in the server cache. If the object in the client cache becomes obsolete, it is retrieved from the server, possibly from the server cache instead of executing the module body.
During configuration development, do not count on automatic updates of cached objects. Use the RefreshReusableValues method for forced cache updates.
If you decide to change certain objects in caches, use one of the following methods to avoid inaccuracies:
- update cached data on the client and on the server simultaneously;
- for modules with Reuse return values property set to During session, set the Server, Client, and possibly External connection properties to True, and set the Server call property to False.