Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions terraform/releases/impl/cache.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resource "aws_cloudfront_response_headers_policy" "cache-immutable" {
name = "cache-immutable"

custom_headers_config {
items {
header = "Cache-Control"
override = true
value = "immutable, max-age=9999999"
}
}
}
23 changes: 23 additions & 0 deletions terraform/releases/impl/cloudfront-doc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,29 @@ resource "aws_cloudfront_distribution" "doc" {
}
}

ordered_cache_behavior {
path_pattern = "*.woff2"
cache_policy_id = "cache-immutable"
allowed_methods = ["GET", "HEAD", "OPTIONS"]
cached_methods = ["GET", "HEAD", "OPTIONS"]
target_origin_id = "main"

forwarded_values {
headers = []
query_string = false

cookies {
forward = "none"
}
}

min_ttl = 0
default_ttl = 86400
max_ttl = 31536000
compress = true
viewer_protocol_policy = "redirect-to-https"
}

origin {
origin_id = "main"
domain_name = aws_s3_bucket.static.website_endpoint
Expand Down