Configure caching
Itential Gateway can cache the results of discovery operations to disk instead of running live discovery every time. Caching reduces repeated discovery load, which is especially useful for gateways with large inventories or frequent discovery requests.
This topic explains how caching works, how to configure it, and what to consider when running multiple Gateway instances on the same host.
How caching works
When caching is enabled, Gateway writes the results of each discovery type to a dedicated JSON file in a configured directory. On subsequent requests, Gateway reads from these files instead of running live discovery, which reduces the time and load associated with repeated discovery operations.
Gateway creates one cache file per discovery type:
When caching is disabled, Gateway always runs live discovery and doesn’t read or write these files.
Configuration properties
Caching is controlled by two top-level properties in properties.yml:
Configure caching
global_cache_enabled and global_cache_directory are part of the System section of properties.yml, so you must edit them directly on the Gateway instance rather than through the UI. Changes to properties.yml require a reboot.
- On the Gateway instance, open
properties.ymlin a text editor. - Set
global_cache_enabledtoTrueorFalse. - Set
global_cache_directoryto the path where you want Gateway to write cache files. - Save the file.
- Restart the Gateway service to apply the changes.
You can review these values under Cache Enabled and Global Cache Directory in the System Configuration section of the UI. This section is locked, since it can only be edited in properties.yml, followed by a server restart.
Cache directory availability
At startup, Gateway checks whether the configured cache directory exists and is writable. If it doesn’t exist or isn’t writable, Gateway logs a warning and continues running without caching rather than failing to start.
If you see a caching warning at startup, verify that global_cache_directory points to a directory that exists on the Gateway instance and that the Gateway service account has write permission to it.
Multiple Gateway instances
If you run multiple Gateway instances on the same host, set a distinct global_cache_directory for each instance. Instances that share a cache directory can overwrite each other’s cache files, which can lead to inconsistent discovery results.