From 6b45365ac6cbc60b1739c75982f54934d57638bc Mon Sep 17 00:00:00 2001 From: Jonas Metzener Date: Tue, 10 Dec 2024 14:08:48 +0100 Subject: [PATCH] fix(cache): add environment variable to configure cache options --- CONFIGURATION.md | 5 +++-- document_merge_service/settings.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index a5f85f20..cfab3c24 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -72,8 +72,9 @@ environment variables: ## Cache -- `CACHE_BACKEND`: [cache backend](https://docs.djangoproject.com/en/1.11/ref/settings/#backend) to use (default: django.core.cache.backends.locmem.LocMemCache) -- `CACHE_LOCATION`: [location](https://docs.djangoproject.com/en/1.11/ref/settings/#std:setting-CACHES-LOCATION) of cache to use +- `CACHE_BACKEND`: [cache backend](https://docs.djangoproject.com/en/4.2/ref/settings/#backend) to use (default: django.core.cache.backends.locmem.LocMemCache) +- `CACHE_LOCATION`: [location](https://docs.djangoproject.com/en/4.2/ref/settings/#location) of cache to use +- `CACHE_OPTIONS`: [options](https://docs.djangoproject.com/en/4.2/ref/settings/#options) for cache library ## CORS diff --git a/document_merge_service/settings.py b/document_merge_service/settings.py index 2a4e2a6e..9979ac05 100644 --- a/document_merge_service/settings.py +++ b/document_merge_service/settings.py @@ -95,7 +95,8 @@ def default(default_dev=env.NOTSET, default_prod=env.NOTSET): "BACKEND": env.str( "CACHE_BACKEND", default="django.core.cache.backends.locmem.LocMemCache" ), - "LOCATION": env.str("CACHE_LOCATION", ""), + "LOCATION": env.str("CACHE_LOCATION", default=""), + "OPTIONS": env.dict("CACHE_OPTIONS", default={}), } }