Skip to content

Commit 38d316f

Browse files
Clarify Data vs System Cache disabling (#505)
* document fully disabling cache * Revert "document fully disabling cache" This reverts commit 97c5928. * add warn callout * Update cache.md * Update cache.md * Update cache.md * Update cache.md
1 parent 14c8660 commit 38d316f

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

content/configuration/cache.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,35 @@ In addition to data-caching, Directus also does some internal caching. Note `CAC
1717
This speed up the overall performance of Directus, as we don't want to introspect the whole database on every request.
1818
::
1919

20+
::callout{icon="material-symbols:warning-rounded" color="warning"}
21+
These settings are shared across all cache drivers. If `CACHE_ENABLED` is disabled, settings marked with **superscript 5** may be used by Directus's caching system. This behavior cannot be turned off.
22+
::
23+
2024
::callout{icon="material-symbols:info-outline"}
2125
**Assets Cache**
2226
`Cache-Control` and `Last-Modified` headers for the `/assets` endpoint are separate from the regular data-cache.
2327
`Last-Modified` comes from `modified_on` DB field. This is useful as it's often possible to cache assets for far longer
2428
than you would cache database content. To learn more, see [Files](/configuration/files).
2529
::
2630

27-
| Variable | Description | Default Value |
28-
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
29-
| `CACHE_ENABLED` | Whether or not data caching is enabled. | `false` |
30-
| `CACHE_TTL`<sup>[1]</sup> | How long the data cache is persisted. | `5m` |
31-
| `CACHE_CONTROL_S_MAXAGE` | Whether to not to add the `s-maxage` expiration flag. Set to a number for a custom value. | `0` |
32-
| `CACHE_AUTO_PURGE`<sup>[2]</sup> | Automatically purge the data cache on actions that manipulate the data. | `false` |
33-
| `CACHE_AUTO_PURGE_IGNORE_LIST`<sup>[3]</sup> | List of collections that prevent cache purging when `CACHE_AUTO_PURGE` is enabled. | `directus_activity,directus_presets` |
34-
| `CACHE_SYSTEM_TTL`<sup>[4]</sup> | How long `CACHE_SCHEMA` is persisted. | -- |
35-
| `CACHE_SCHEMA`<sup>[4]</sup> | Whether or not the database schema is cached. One of `false`, `true` | `true` |
36-
| `CACHE_SCHEMA_MAX_ITERATIONS`<sup>[4]</sup> | Safe value to limit max iterations on get schema cache. This value should only be adjusted for high scaling applications. | `100` |
37-
| `CACHE_SCHEMA_SYNC_TIMEOUT` | How long to wait for other containers to message before trying again | `10000` |
38-
| `CACHE_SCHEMA_FREEZE_ENABLED` | Whether or not to freeze the schema to improve memory efficiency | false |
39-
| `CACHE_NAMESPACE` | How to scope the cache data. | `system-cache` |
40-
| `CACHE_STORE`<sup>[5]</sup> | Where to store the cache data. Either `memory`, `redis`. | `memory` |
41-
| `CACHE_STATUS_HEADER` | If set, returns the cache status in the configured header. One of `HIT`, `MISS`. | -- |
42-
| `CACHE_VALUE_MAX_SIZE` | Maximum size of values that will be cached. Accepts number of bytes, or human readable string. Use `false` for no limit | false |
43-
| `CACHE_SKIP_ALLOWED` | Whether requests can use the Cache-Control header with `no-store` to skip data caching. | false |
44-
| `CACHE_HEALTHCHECK_THRESHOLD` | Healthcheck timeout threshold in ms. | `150` |
31+
| Variable | Description | Default Value |
32+
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
33+
| `CACHE_ENABLED` | Whether or not data caching is enabled. | `false` |
34+
| `CACHE_TTL`<sup>[1]</sup> | How long the data cache is persisted. | `5m` |
35+
| `CACHE_CONTROL_S_MAXAGE` | Whether to not to add the `s-maxage` expiration flag. Set to a number for a custom value. | `0` |
36+
| `CACHE_AUTO_PURGE`<sup>[2]</sup> | Automatically purge the data cache on actions that manipulate the data. | `false` |
37+
| `CACHE_AUTO_PURGE_IGNORE_LIST`<sup>[3]</sup> | List of collections that prevent cache purging when `CACHE_AUTO_PURGE` is enabled. | `directus_activity,directus_presets` |
38+
| `CACHE_SYSTEM_TTL`<sup>[4]</sup><sup>[5]</sup> | How long `CACHE_SCHEMA` is persisted. | -- |
39+
| `CACHE_SCHEMA`<sup>[4]</sup> | Whether or not the database schema is cached. One of `false`, `true` | `true` |
40+
| `CACHE_SCHEMA_MAX_ITERATIONS`<sup>[4]</sup> | Safe value to limit max iterations on get schema cache. This value should only be adjusted for high scaling applications. | `100` |
41+
| `CACHE_SCHEMA_SYNC_TIMEOUT` | How long to wait for other containers to message before trying again | `10000` |
42+
| `CACHE_SCHEMA_FREEZE_ENABLED` | Whether or not to freeze the schema to improve memory efficiency | false |
43+
| `CACHE_NAMESPACE`<sup>[5]</sup> | How to scope the cache data. | `system-cache` |
44+
| `CACHE_STORE`<sup>[5]</sup> | Where to store the cache data. Either `memory`, `redis`. | `memory` |
45+
| `CACHE_STATUS_HEADER` | If set, returns the cache status in the configured header. One of `HIT`, `MISS`. | -- |
46+
| `CACHE_VALUE_MAX_SIZE` | Maximum size of values that will be cached. Accepts number of bytes, or human readable string. Use `false` for no limit | false |
47+
| `CACHE_SKIP_ALLOWED` | Whether requests can use the Cache-Control header with `no-store` to skip data caching. | false |
48+
| `CACHE_HEALTHCHECK_THRESHOLD` | Healthcheck timeout threshold in ms. | `150` |
4549

4650
<sup>[1]</sup> `CACHE_TTL` Based on your project's needs, you might be able to aggressively cache your data, only
4751
requiring new data to be fetched every hour or so. This allows you to squeeze the most performance out of your Directus

0 commit comments

Comments
 (0)