File tree Expand file tree Collapse file tree 2 files changed +17
-20
lines changed
Expand file tree Collapse file tree 2 files changed +17
-20
lines changed Original file line number Diff line number Diff line change 1- import django_cache_url
2-
31from madewithwagtail .settings import ENVIRONMENT , PROJECT # , CACHE_URL
42
3+
54__all__ = [
65 "CACHES" ,
7- "CACHALOT_TIMEOUT" ,
8- "WAGTAILFRONTENDCACHE" ,
96] # don't import DEV_CACHES by default
107
118# Dont use redis because we don't need it
2623
2724# Add a prefix to distinguish huey entries and app entries
2825CACHES .get ("default" ).update ({"PREFIX" : "-" .join ([PROJECT , ENVIRONMENT ])})
29-
30- # When this isn't set, it will eventually fill up redis
31- CACHALOT_TIMEOUT = 300
32-
33- # For frontend cache module
34- WAGTAILFRONTENDCACHE = {
35- "cloudfront" : {
36- "BACKEND" : "wagtail.contrib.frontend_cache.backends.CloudfrontBackend" ,
37- "DISTRIBUTION_ID" : {
38- # TODO change this when do the DNS changeover to madewithwagtail.org
39- "madewithwagtail-preview-media.s3-website-ap-southeast-2.amazonaws.com" : "E19LUSH371PZQA" ,
40- },
41- }
42- }
Original file line number Diff line number Diff line change 44from .grains .logging import LOGGING
55from .grains .sentry import *
66
7+ from typed_environment_configuration import StringVariable
8+
9+ AWS_CONTENT_DISTRIBUTION_ID = StringVariable (
10+ "AWS_CONTENT_DISTRIBUTION_ID" , default = ""
11+ ).getenv ()
12+
713# Google Analytics settings
814GOOGLE_TAG_MANAGER = False
915
3137TASKS_RETRY_DELAY = 5 * 60 # 5 minutes delay
3238
3339
34- CACHE_MIDDLEWARE_SECONDS = 86400 # 24 hours
35- CACHE_TEMPLATE_FRAGMENTS_SECONDS = 86400 # 24 hours
40+ CACHE_MIDDLEWARE_SECONDS = 600
41+ CACHE_TEMPLATE_FRAGMENTS_SECONDS = 600
3642
3743# Make sure we include the needed Middleware apps
3844# Excluding logged in (admin) requests
3945CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
4046
4147SECURE_HSTS_SECONDS = 31536000
48+
49+ # For frontend cache module
50+ WAGTAILFRONTENDCACHE = {
51+ "cloudfront" : {
52+ "BACKEND" : "wagtail.contrib.frontend_cache.backends.CloudfrontBackend" ,
53+ "DISTRIBUTION_ID" : AWS_CONTENT_DISTRIBUTION_ID ,
54+ }
55+ }
You can’t perform that action at this time.
0 commit comments