Skip to content

Commit

Permalink
Don't cache the checker healthcheck endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathonherbert committed Apr 10, 2024
1 parent 57d94c7 commit 620eb37
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cdk/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,16 @@ EOF
parameters.CheckerCertificate.valueAsString
);

const checkerOrigin = new LoadBalancerV2Origin(checkerApp.loadBalancer, {
protocolPolicy: OriginProtocolPolicy.HTTPS_ONLY,
});

const checkerCloudFrontDistro = new Distribution(
this,
"typerighter-cloudfront",
{
defaultBehavior: {
origin: new LoadBalancerV2Origin(checkerApp.loadBalancer, {
protocolPolicy: OriginProtocolPolicy.HTTPS_ONLY,
}),
origin: checkerOrigin,
allowedMethods: AllowedMethods.ALLOW_ALL,
cachePolicy: new CachePolicy(
this,
Expand All @@ -248,6 +250,8 @@ EOF
}
);

checkerCloudFrontDistro.addBehavior("/healthcheck", checkerOrigin, { cachePolicy: CachePolicy.CACHING_DISABLED });

This comment has been minimized.

Copy link
@davidfurey

davidfurey Apr 10, 2024

Member

Any reason not to just set a Cache-Control: None header in the application rather than having this set here, so far from the application code?


const checkerDnsRecord = new GuDnsRecordSet(this, "checker-dns-records", {
name: checkerDomain,
recordType: RecordType.CNAME,
Expand Down

0 comments on commit 620eb37

Please sign in to comment.