|
Enable SCM cache from the admin area in Stash. Click Manage Add-ons (under 'Add-Ons') and filter for system add-ons. Click SCM Cache Plugin for Stash and then either Enable or Disable.
The SCM Cache plugin for Stash can be configured using either the REST endpoint (some settings, not all) or the system properties in <STASH-HOME>/stash-config.properties. Settings configured through REST are considered before the settings in stash-config.properties.
| 設定 | 既定値 | 説明 |
|---|---|---|
plugin.stash-scm-cache.expiry.check.interval | 300 (5 min) | Controls how frequently expired caches are checked and deleted from disk. Time is in SECONDS. |
plugin.stash-scm-cache.minimum.free.space | 1073741824 (1 Gb) | Controls how much space needs to be available on disk (specifically under <STASH-HOME>/caches) for caching to be enabled. This setting ensures that the cache plugin does not fill up the disk. Value is in BYTES. |
plugin.stash-scm-cache.refs.enabled | false | Controls whether ref advertisement operations are cached. |
plugin.stash-scm-cache.refs.ttl | 60 (1 min) | Controls how long the caches for ref advertisements are kept around when there no changes to the repository. Caches are automatically invalidated when someone pushes to a repository or when a pull request is merged. Time is in SECONDS. |
plugin.stash-scm-cache.upload-pack.enabled | true | Controls whether clone operations are cached. |
plugin.stash-scm-cache.upload-pack.ttl | 3600 (1 hour) | Controls how long the caches for clone operations are kept around when there no changes to the repository. Caches are automatically invalidated when someone pushes to a repository or when a pull request is merged. Time is in SECONDS. |
| Method | Url | 説明 |
|---|---|---|
| GET | /rest/scm-cache/latest/config/refs/enabled | Retrieve whether ref advertisement caching is enabled (true) or disabled (false). |
| PUT | /rest/scm-cache/latest/config/refs/enabled/{status} | Enable (status = true) or disable (status = false) ref advertisement caching. |
| GET | /rest/scm-cache/latest/config/refs/ttl | Retrieve the expiry in seconds for the ref advertisement caches. |
| PUT | /rest/scm-cache/latest/config/refs/ttl/{expiryInSec} | Set the expiry in seconds for the ref advertisement caches. |
| GET | /rest/scm-cache/latest/config/upload-pack/enabled | Retrieve the whether clone caching is enabled (true) or disabled (false). |
| PUT | /rest/scm-cache/latest/config/upload-pack/enabled/{status} | Enable (status = true) or disable (status = false) clone caching. |
| GET | /rest/scm-cache/latest/config/upload-pack/ttl | Retrieve the expiry in seconds for the clone caches. |
| PUT | /rest/scm-cache/latest/config/upload-pack/ttl/{expiryInSec} | Set the expiry in seconds for the clone caches. |
| GET | /rest/scm-cache/latest/caches | Retrieve information about the current caches: size, number of cache hits and misses, etc. |
| 削除 | /rest/scm-cache/latest/caches | Clear all caches. |
| GET | /rest/scm-cache/latest/caches/{projectKey}/{repoSlug} | Retrieve information about the caches for the repository identified by projectKey and repoSlug: size, number of cache hits and misses, etc. |
| 削除 | /rest/scm-cache/latest/caches/{projectKey}/{repoSlug} | Clear the caches for the repository identified by projectKey and repoSlug. |