You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In such case older keys with prefix `falcondev-oss/github-actions-cache-server_dev_docker-cache` will be automatically
96
+
removed whenever there are more records for this key type then the one specified via `MAX_STORED_KEYS_PER_TYPE`.
97
+
98
+
#### `MAX_STORED_KEYS_PER_TYPE`
99
+
100
+
- Default: `3`
101
+
102
+
If `ENABLE_TYPED_KEY_PREFIX_REMOVAL` is `true` then this is the maximum amount of the most recent keys to keep per key type.
103
+
Any other older keys will be automatically removed.
104
+
105
+
#### `TYPED_KEY_DELIMITER`
106
+
107
+
- Default: `@#@`
108
+
109
+
If `ENABLE_TYPED_KEY_PREFIX_REMOVAL` is `true` then this is the delimiter which is used to identify the key type.
110
+
Any prefix before `@#@` is considered to be the key type.
111
+
80
112
## 2. Setup with Self-Hosted Runners
81
113
82
114
To leverage the GitHub Actions Cache Server with your self-hosted runners, you'll need to configure a couple of environment variables on your runners. This ensures that your runners can authenticate with and utilize the cache server effectively.
@@ -139,3 +171,22 @@ Doing it this way is a bit of a hack, but it's easier than compiling your own ru
139
171
There is no need to change any of your workflows! 🔥
140
172
141
173
If you've set up your self-hosted runners correctly, they will automatically use the cache server for caching.
174
+
175
+
## 4. Cache cleanup
176
+
177
+
Cache cleanup can be triggered automatically via configured eviction policies like:
178
+
- `CLEANUP_OLDER_THAN_DAYS`- eviction by time.
179
+
- `ENABLE_TYPED_KEY_PREFIX_REMOVAL`- eviction by key type (key prefix).
180
+
181
+
Moreover, an additional API exists which can be used to evict key records by using specified key prefix.
182
+
API path: `/<token>/extra/clear_key_prefix`. API method: `POST`.
183
+
Request body: `{ keyPrefix: string }`.
184
+
185
+
Any keys with the prefix of `keyPrefix` will be removed and data will be cleared for such keys.
186
+
Usually, it's useful to call keys removal for an archived branch or a closed PR where you know that the cache won't
187
+
be reused anymore. For such cases you could have a step which is called and clears all keys prefixed with the branch name.
0 commit comments