🔧(back) configure cache key prefix

We want to change the cache key prefix using an environment variable.
This settings can be changed at every deployment in order to reset to
use a fresh new cache.
This commit is contained in:
Manuel Raynaud
2025-05-07 22:12:39 +02:00
parent 16e20e984c
commit 31d0733851
2 changed files with 6 additions and 0 deletions

View File

@@ -913,6 +913,11 @@ class Production(Base):
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
},
"KEY_PREFIX": values.Value(
"docs",
environ_name="CACHES_KEY_PREFIX",
environ_prefix=None,
),
},
}

View File

@@ -63,6 +63,7 @@ backend:
STORAGES_STATICFILES_BACKEND: django.contrib.staticfiles.storage.StaticFilesStorage
Y_PROVIDER_API_BASE_URL: http://impress-y-provider:443/api/
Y_PROVIDER_API_KEY: my-secret
CACHES_KEY_PREFIX: "{{ now | unixEpoch }}"
migrate:
command:
- "/bin/sh"