Skip to content

Commit

Permalink
update cdn cache policy, allow newer http methods
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmiglio committed Jun 4, 2024
1 parent dea44bf commit a9c1ddc
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions aws/DistStack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,14 @@ Resources:
SmoothStreaming: false
TargetOriginId: !GetAtt S3Bucket.RegionalDomainName
ViewerProtocolPolicy: "redirect-to-https"
ForwardedValues:
QueryString: false
Cookies:
Forward: none
CachePolicyId: !Ref CloudFrontCachePolicy
Comment: !Sub "${ResourcePrefix} Distribution"
PriceClass: "PriceClass_100"
Enabled: true
Restrictions:
GeoRestriction:
RestrictionType: "none"
HttpVersion: "http2"
HttpVersion: "http2and3"
Aliases:
- !Sub "${Domain}"
ViewerCertificate:
Expand All @@ -97,6 +94,24 @@ Resources:
SslSupportMethod: sni-only
IPV6Enabled: true

CloudFrontCachePolicy:
Type: "AWS::CloudFront::CachePolicy"
Properties:
CachePolicyConfig:
Name: !Sub "${ResourcePrefix}-cache-policy"
DefaultTTL: 86400
MaxTTL: 31536000
MinTTL: 1
ParametersInCacheKeyAndForwardedToOrigin:
EnableAcceptEncodingGzip: true
EnableAcceptEncodingBrotli: true
CookiesConfig:
CookieBehavior: "none"
HeadersConfig:
HeaderBehavior: "none"
QueryStringsConfig:
QueryStringBehavior: "none"

CloudFrontOriginAccessControl:
Type: "AWS::CloudFront::OriginAccessControl"
Properties:
Expand Down

0 comments on commit a9c1ddc

Please sign in to comment.