Skip to content

Commit 31d0733

Browse files
committed
🔧(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.
1 parent 16e20e9 commit 31d0733

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/backend/impress/settings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,11 @@ class Production(Base):
913913
"OPTIONS": {
914914
"CLIENT_CLASS": "django_redis.client.DefaultClient",
915915
},
916+
"KEY_PREFIX": values.Value(
917+
"docs",
918+
environ_name="CACHES_KEY_PREFIX",
919+
environ_prefix=None,
920+
),
916921
},
917922
}
918923

src/helm/env.d/dev/values.impress.yaml.gotmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ backend:
6363
STORAGES_STATICFILES_BACKEND: django.contrib.staticfiles.storage.StaticFilesStorage
6464
Y_PROVIDER_API_BASE_URL: http://impress-y-provider:443/api/
6565
Y_PROVIDER_API_KEY: my-secret
66+
CACHES_KEY_PREFIX: "{{ now | unixEpoch }}"
6667
migrate:
6768
command:
6869
- "/bin/sh"

0 commit comments

Comments
 (0)