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
Copy file name to clipboardExpand all lines: src/content/docs/docs/configuration.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@ The configuration supports the following options:
22
22
-`cache.use_default_cache` (bool): Load baked recipes from the official Brioche cache if not found otherwise. Defaults to `true`. When a custom cache is also enabled, the custom cache acts as an overlay and will be checked before the default cache.
23
23
-`cache.read_only` (bool): Don't try to write to the custom cache-- only fetch values that have already been cached from the cache specified by `url`. Defaults to `false`.
24
24
-`cache.allow_http` (bool): Allow insecure HTTP access for the cache. Defaults to `false`, which means requests to the cache must go over HTTPS.
25
+
-`cache.write_url`(string): An alternative cache URL to use just for writes, while reads still use `cache.url`. This may be useful if `cache.url` is a read-only cache in front of an object storage provider. **Note:** This option should be used with caution!
25
26
26
27
## Sandbox configuration
27
28
@@ -100,8 +101,9 @@ You can also configure the cache using the following environment variables:
100
101
-`$BRIOCHE_CACHE_READ_ONLY`
101
102
-`$BRIOCHE_CACHE_MAX_CONCURRENT_OPERATIONS`
102
103
-`$BRIOCHE_CACHE_ALLOW_HTTP`
104
+
-`$BRIOCHE_CACHE_WRITE_URL`
103
105
104
-
The URL scheme of the value for `cache.url` (or `$BRIOCHE_CACHE_URL`) determines which cache backend to use. The following URL schemes are supported:
106
+
The cache URL scheme for `cache.url`, `$BRIOCHE_CACHE_URL`, etc. determines which cache backend to use. The following URL schemes are supported:
105
107
106
108
-`s3://`: AWS S3 or an S3-compatible object storage provider
107
109
- Full URL structure: `s3://<bucket>/<prefix>` (`prefix` is optional)
@@ -110,3 +112,9 @@ The URL scheme of the value for `cache.url` (or `$BRIOCHE_CACHE_URL`) determines
110
112
-`https://`: Read from a plain HTTPS server (or `http://` for plain HTTP)
111
113
-**Note**: It's recommended to set the `read_only = true` option when with HTTP(S). HTTP support is handled through [`object_store`](https://docs.rs/object_store/0.12.0/object_store/http/index.html) which will attempt to use WebDAV when writing to the cache, but this may change in the future. Please reach out if you have a need for writing to a cache via WebDAV!
112
114
-`file://`: Directory on the local filesystem
115
+
116
+
If `cache.write_url` is set, the URL is used just for cache writes, while reads always use `cache.url`. This can be useful if `cache.url` points to a suitable caching HTTP proxy server (say, [server3](https://github.com/kylewlacy/server3) or [Vinyl Cache](https://vinyl-cache.org/)), while `cache.write_url` points to the underlying storage system (such as an S3 bucket).
117
+
118
+
:::caution
119
+
Special care should be taken when using `cache.write_url`, and things may not work as expected if the contents don't match with `cache.url`-- potentially leading to a "split brain" scenario with the cache!
0 commit comments