diff --git a/tcf_core/settings/base.py b/tcf_core/settings/base.py index 71bed5652..dcddc3bc7 100644 --- a/tcf_core/settings/base.py +++ b/tcf_core/settings/base.py @@ -73,7 +73,7 @@ AWS_S3_REGION_NAME = env.str("AWS_S3_REGION_NAME", default="us-east-1") AWS_S3_CUSTOM_DOMAIN = f"{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com" AWS_DEFAULT_ACL = None - AWS_S3_OBJECT_PARAMETERS = {"CacheControl": "max-age=86400"} + STATIC_URL = f"https://{AWS_S3_CUSTOM_DOMAIN}/static/" ALLOWED_HOSTS.extend( [ @@ -86,10 +86,17 @@ STORAGES = { "default": { "BACKEND": "storages.backends.s3.S3Storage", - "OPTIONS": {}, + "OPTIONS": { + "location": "media", + "object_parameters": {"CacheControl": "max-age=86400"}, # 1 day for media + }, }, "staticfiles": { - "BACKEND": "storages.backends.s3.S3Storage", + "BACKEND": "storages.backends.s3.S3ManifestStaticStorage", + "OPTIONS": { + "location": "static", + "object_parameters": {"CacheControl": "max-age=31536000"}, # 1 year for static + }, }, }