From 2b2115e5f0cab536b1a2273a7c9f36b853908dc1 Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Tue, 11 Feb 2025 08:18:19 -0800 Subject: [PATCH] Enhancement: Use cached sessions for a minor performance improvement (#9074) --- src/paperless/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/paperless/settings.py b/src/paperless/settings.py index 6a5e98f46..e92d9dc5a 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -510,6 +510,8 @@ SESSION_EXPIRE_AT_BROWSER_CLOSE = not ACCOUNT_SESSION_REMEMBER SESSION_COOKIE_AGE = int( os.getenv("PAPERLESS_SESSION_COOKIE_AGE", 60 * 60 * 24 * 7 * 3), ) +# https://docs.djangoproject.com/en/5.1/ref/settings/#std-setting-SESSION_ENGINE +SESSION_ENGINE = "django.contrib.sessions.backends.cached_db" if AUTO_LOGIN_USERNAME: _index = MIDDLEWARE.index("django.contrib.auth.middleware.AuthenticationMiddleware")