@@ -678,6 +678,7 @@ Resources:
678678 Type : AWS::CloudFront::Distribution
679679 Properties :
680680 DistributionConfig :
681+ HttpVersion : ' http2and3'
681682 Origins :
682683 - Id : S3WebsiteOrigin
683684 DomainName : !GetAtt AppFrontendS3Bucket.RegionalDomainName
@@ -699,6 +700,7 @@ Resources:
699700 - UiDomainName
700701
701702 DefaultCacheBehavior :
703+ Compress : true
702704 TargetOriginId : S3WebsiteOrigin
703705 ViewerProtocolPolicy : redirect-to-https
704706 AllowedMethods :
@@ -732,6 +734,7 @@ Resources:
732734 - HEAD
733735 CachePolicyId : !Ref CloudfrontCachePolicy
734736 OriginRequestPolicyId : 216adef6-5c7f-47e4-b989-5492eafa07d3
737+ Compress : true
735738 - PathPattern : " /api/v1/organizations"
736739 TargetOriginId : ApiGatewayOrigin
737740 ViewerProtocolPolicy : redirect-to-https
@@ -748,6 +751,7 @@ Resources:
748751 - HEAD
749752 CachePolicyId : " 658327ea-f89d-4fab-a63d-7e88639e58f6"
750753 OriginRequestPolicyId : 216adef6-5c7f-47e4-b989-5492eafa07d3
754+ Compress : true
751755 - PathPattern : " /api/documentation*"
752756 TargetOriginId : ApiGatewayOrigin
753757 ViewerProtocolPolicy : redirect-to-https
@@ -764,6 +768,7 @@ Resources:
764768 - HEAD
765769 CachePolicyId : " 658327ea-f89d-4fab-a63d-7e88639e58f6"
766770 OriginRequestPolicyId : 216adef6-5c7f-47e4-b989-5492eafa07d3
771+ Compress : true
767772 - PathPattern : " /api/*"
768773 TargetOriginId : ApiGatewayOrigin
769774 ViewerProtocolPolicy : redirect-to-https
@@ -778,16 +783,16 @@ Resources:
778783 CachedMethods :
779784 - GET
780785 - HEAD
781- CachePolicyId : 4135ea2d-6df8-44a3-9df3-4b5a84be39ad # caching disabled
786+ CachePolicyId : !Ref CloudfrontNoCachePolicy # caching disabled
782787 OriginRequestPolicyId : 216adef6-5c7f-47e4-b989-5492eafa07d3
788+ Compress : true
783789 ViewerCertificate :
784790 AcmCertificateArn : !FindInMap
785791 - ApiGwConfig
786792 - !Ref RunEnvironment
787793 - EnvCertificateArn
788794 MinimumProtocolVersion : TLSv1.2_2021
789795 SslSupportMethod : sni-only
790- HttpVersion : http2
791796 PriceClass : PriceClass_100
792797
793798 AppFrontendS3BucketPolicy :
@@ -803,6 +808,25 @@ Resources:
803808 Action : s3:GetObject
804809 Resource : !Sub "${AppFrontendS3Bucket.Arn}/*"
805810
811+ CloudfrontNoCachePolicy :
812+ Type : AWS::CloudFront::CachePolicy
813+ Properties :
814+ CachePolicyConfig :
815+ Comment : Cache policy with caching disabled and Gzip/Brotli enabled
816+ DefaultTTL : 0
817+ MaxTTL : 1
818+ MinTTL : 0
819+ Name : NoCache-GzipBrotli-Enabled
820+ ParametersInCacheKeyAndForwardedToOrigin :
821+ CookiesConfig :
822+ CookieBehavior : none
823+ EnableAcceptEncodingBrotli : true
824+ EnableAcceptEncodingGzip : true
825+ HeadersConfig :
826+ HeaderBehavior : none
827+ QueryStringsConfig :
828+ QueryStringBehavior : none
829+
806830 CloudfrontCachePolicy :
807831 Type : AWS::CloudFront::CachePolicy
808832 Properties :
@@ -860,6 +884,7 @@ Resources:
860884 Type : AWS::CloudFront::Distribution
861885 Properties :
862886 DistributionConfig :
887+ HttpVersion : ' http2and3'
863888 Origins :
864889 - Id : ApiGatewayOrigin
865890 DomainName : !Sub "${AppApiGateway}.execute-api.${AWS::Region}.amazonaws.com"
@@ -878,6 +903,7 @@ Resources:
878903 - !Ref RunEnvironment
879904 - EnvDomainName
880905 DefaultCacheBehavior :
906+ Compress : true
881907 TargetOriginId : ApiGatewayOrigin
882908 ViewerProtocolPolicy : redirect-to-https
883909 AllowedMethods :
@@ -904,7 +930,6 @@ Resources:
904930 - EnvCertificateArn
905931 MinimumProtocolVersion : TLSv1.2_2021
906932 SslSupportMethod : sni-only
907- HttpVersion : http2
908933 PriceClass : PriceClass_100
909934
910935 LinkryRecordsCloudfrontStore :
@@ -962,6 +987,7 @@ Resources:
962987 Type : AWS::CloudFront::Distribution
963988 Properties :
964989 DistributionConfig :
990+ HttpVersion : ' http2and3'
965991 Enabled : true
966992 DefaultCacheBehavior :
967993 ViewerProtocolPolicy : redirect-to-https
@@ -993,7 +1019,6 @@ Resources:
9931019 - EnvCertificateArn
9941020 MinimumProtocolVersion : TLSv1.2_2021
9951021 SslSupportMethod : sni-only
996- HttpVersion : http2
9971022 PriceClass : PriceClass_100
9981023
9991024 LinkryDomainProxy :
0 commit comments