diff --git a/terraform/cloudfront.tf b/terraform/cloudfront.tf index 0e58b3d..5238f9e 100644 --- a/terraform/cloudfront.tf +++ b/terraform/cloudfront.tf @@ -90,7 +90,8 @@ resource "aws_cloudfront_distribution" "main" { viewer_protocol_policy = "redirect-to-https" compress = true - cache_policy_id = "4135ea2d-6df8-44a3-9df3-4b5a84be39ad" #Managed-CachingDisabled + # cache_policy_id = "4135ea2d-6df8-44a3-9df3-4b5a84be39ad" #Managed-CachingDisabled + cache_policy_id = aws_cloudfront_cache_policy.default.id origin_request_policy_id = aws_cloudfront_origin_request_policy.admin.id function_association { @@ -114,9 +115,9 @@ resource "aws_cloudfront_distribution" "main" { resource "aws_cloudfront_cache_policy" "default" { name = "${local.namespace}-cache-policy" - min_ttl = 60 - default_ttl = 60 - max_ttl = 60 + min_ttl = 3600 + default_ttl = 3600 + max_ttl = 3600 parameters_in_cache_key_and_forwarded_to_origin { enable_accept_encoding_brotli = true