Simple updates to the resource cache can be made in the Management Console. There are three properties that can be configured to change the cache: capacity, policy, and expiry of resources in the files. Changes to these properties persist after restarting the Spatial services.
It is important to note, the larger the capacity, the more memory will be used. Both the capacity and policy should be set based on your specific requirements. For example, if the resources in your repository will never change once created, the capacity can be set lower, and the policy can be set to never.
To modify the cache settings for the remote component using the properties for Spatial:
The remote component (JVM instance) automatically restarts with the change.
Repository cache properties are:
- repository.cache.capacity This is the number of resources cached by the remote component at any given time. If the capacity is modified, the current resource cache will be cleared, and a new one created. As the capacity is reached, older resources in the cache are removed to make room for newer resources. It is important to remember, if a resource is cached that uses other resources (e.g., a named map uses multiple named tables), both that resource and all resources used are also cached.
- repository.cache.policy This is the way resources in the cache will be checked to see if they need to be updated with the latest version in the repository. The policy values are 0, 1,2 or 3. Where 0=Never, 1=Always, 2=Check with Expire, and 3=Change Event. Never checking the resource cache means that no checking for resource updating is done. Cached resources can be removed if they are changed in the repository and you need to modify the cache. Always checking the resource cache means that every time a resource is required from the cache, it will check if the cached resource is the same as in the repository. If the resource has changed, a new one will be loaded into the cache. Checking with expiry will only check resources in the cache for updating if the expire time since the last check has been exceeded. The expire time is the value defined in the repository.cache.expire property. This value is in milliseconds.
- repository.cache.expire This is the expiry time in milliseconds. If the cache policy is set to 2 (check with expire), this value is used as the interval to check for updating the resource when trying to be accessed.