@@ -633,14 +633,8 @@ Resources:
633
633
CachedMethods :
634
634
- GET
635
635
- HEAD
636
- ForwardedValues :
637
- QueryString : true
638
- QueryStringCacheKeys :
639
- - host
640
- - ts
641
- - upcomingOnly
642
- Cookies :
643
- Forward : none
636
+ CachePolicyId : !Ref CloudfrontCachePolicy
637
+ OriginRequestPolicyId : b689b0a8-53d0-40ab-baf2-68738e2966ac # all except host
644
638
- PathPattern : " /api/v1/events/*"
645
639
TargetOriginId : ApiGatewayOrigin
646
640
ViewerProtocolPolicy : redirect-to-https
@@ -655,14 +649,8 @@ Resources:
655
649
CachedMethods :
656
650
- GET
657
651
- HEAD
658
- ForwardedValues :
659
- QueryString : true
660
- QueryStringCacheKeys :
661
- - host
662
- - ts
663
- - upcomingOnly
664
- Cookies :
665
- Forward : none
652
+ CachePolicyId : !Ref CloudfrontCachePolicy
653
+ OriginRequestPolicyId : b689b0a8-53d0-40ab-baf2-68738e2966ac # all except host
666
654
- PathPattern : " /api/*"
667
655
TargetOriginId : ApiGatewayOrigin
668
656
ViewerProtocolPolicy : redirect-to-https
@@ -707,6 +695,31 @@ Resources:
707
695
Action : s3:GetObject
708
696
Resource : !Sub "${AppFrontendS3Bucket.Arn}/*"
709
697
698
+ CloudfrontCachePolicy :
699
+ Type : AWS::CloudFront::CachePolicy
700
+ Properties :
701
+ CachePolicyConfig :
702
+ Name : UseOriginCacheControlHeaders-QueryStrings-NoCookies
703
+ Comment : " Policy for origins that return Cache-Control headers and serve different content based on query strings but dont require cookies."
704
+ DefaultTTL : 0
705
+ MaxTTL : 31536000
706
+ MinTTL : 0
707
+ ParametersInCacheKeyAndForwardedToOrigin :
708
+ EnableAcceptEncodingGzip : true
709
+ EnableAcceptEncodingBrotli : true
710
+ HeadersConfig :
711
+ HeaderBehavior : whitelist
712
+ Headers :
713
+ - x-method-override
714
+ - origin
715
+ - host
716
+ - x-http-method
717
+ - x-http-method-override
718
+ QueryStringsConfig :
719
+ QueryStringBehavior : all
720
+ CookiesConfig :
721
+ CookieBehavior : none
722
+
710
723
Outputs :
711
724
DomainName :
712
725
Description : Domain name that the UI is hosted at
0 commit comments