From 18dcc4b584042c0e370c907a3787ea1deb377173 Mon Sep 17 00:00:00 2001 From: Zhengen TANG Date: Tue, 15 Sep 2026 10:34:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E6=94=B9=E7=94=A8=20LocMemCache=20=E6=9B=BF=E4=BB=A3=20Redis?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=20Windows=20=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E5=BC=95=E5=85=A5=E5=A4=96=E9=83=A8=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wagtailcms/settings/production.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wagtailcms/settings/production.py b/wagtailcms/settings/production.py index cce2693..08efdc4 100644 --- a/wagtailcms/settings/production.py +++ b/wagtailcms/settings/production.py @@ -26,10 +26,13 @@ EMAIL_USE_TLS = env.bool("EMAIL_USE_TLS", default=True) DEFAULT_FROM_EMAIL = env("DEFAULT_FROM_EMAIL", default=EMAIL_HOST_USER) +# 生产环境为单进程 Waitress(--threads=N,非多进程/多实例部署),无需跨进程共享缓存, +# 用 Django 内置的进程内 LocMemCache 即可满足 Wagtail Site.get_site_root_paths() 等缓存需求, +# 避免在 Windows Server 上引入额外的 Redis/Memurai 服务及其授权、运维成本。 +# 若未来扩展为多进程/多实例部署,需改回共享缓存后端(如 Redis)。 CACHES = { "default": { - "BACKEND": "django.core.cache.backends.redis.RedisCache", - "LOCATION": env("REDIS_URL", default="redis://redis:6379/1"), + "BACKEND": "django.core.cache.backends.locmem.LocMemCache", } }