Skip to content

Commit

Permalink
Create a cache behavior for statistics (#2029)
Browse files Browse the repository at this point in the history
* Create a cache behavior for statistics

* Use legacy cache settings
  • Loading branch information
sukhpalp authored Jul 15, 2024
1 parent 9bd2b93 commit 0d3a4b6
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions terraform/cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,19 @@ resource "aws_cloudfront_distribution" "wfnews_geofencing_nginx" {
target_origin_id = "wfnews_nginx_${var.target_env}"
compress = true
viewer_protocol_policy = "redirect-to-https"
cache_policy_id = "658327ea-f89d-4fab-a63d-7e88639e58f6"

min_ttl = 3600
default_ttl = 43200
max_ttl = 86400

forwarded_values {
query_string = true
headers = ["Origin", "Authorization", "X-API-KEY", "apikey"]

cookies {
forward = "all"
}
}

response_headers_policy_id = aws_cloudfront_response_headers_policy.cache_control_response_headers.id
}
Expand Down Expand Up @@ -591,7 +603,19 @@ resource "aws_cloudfront_distribution" "wfnews_geofencing_gov_api" {
target_origin_id = "wfnews_nginx_gov_${var.target_env}"
compress = true
viewer_protocol_policy = "redirect-to-https"
cache_policy_id = "658327ea-f89d-4fab-a63d-7e88639e58f6"

min_ttl = 3600
default_ttl = 43200
max_ttl = 86400

forwarded_values {
query_string = true
headers = ["Origin", "Authorization", "X-API-KEY", "apikey"]

cookies {
forward = "all"
}
}

response_headers_policy_id = aws_cloudfront_response_headers_policy.cache_control_response_headers.id
}
Expand Down

0 comments on commit 0d3a4b6

Please sign in to comment.