From 2ab574a7ee938ba6da935cbc3acac35778cb7db1 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 28 Aug 2017 15:04:11 +0200 Subject: Performance: keep db connection - cache sessions --- example_project/settings.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'example_project/settings.py') diff --git a/example_project/settings.py b/example_project/settings.py index 2d19cacc6..c9abdf9f5 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -304,3 +304,9 @@ if SQL_DEBUG: if 'test' in sys.argv: PROJECT_SLUG += "-test" + +if not DEBUG: + # persistent connection + DATABASES['default']['CONN_MAX_AGE'] = 600 + # session in cache and database + SESSION_ENGINE = "django.contrib.sessions.backends.cached_db" -- cgit v1.2.3