Skip to content

Commit

Permalink
キャッシュポリシーコメントアウト
Browse files Browse the repository at this point in the history
  • Loading branch information
takecchi committed Dec 19, 2023
1 parent 380ff47 commit 095d336
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions sst.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { SSTConfig } from 'sst';
import { NextjsSite } from 'sst/constructs';
import { CacheHeaderBehavior, CachePolicy } from 'aws-cdk-lib/aws-cloudfront';
import { Duration } from 'aws-cdk-lib';

export default {
config(_input) {
Expand All @@ -18,19 +16,19 @@ export default {
domain = `${stack.stage}.${domain}`;
}
// CloudFrontでキャッシュさせたい場合に使用すること
const _serverCachePolicy = new CachePolicy(stack, 'ServerCache', {
minTtl: Duration.seconds(86400),
defaultTtl: Duration.seconds(86400),
headerBehavior: CacheHeaderBehavior.allowList(
'accept',
'rsc',
'next-router-prefetch',
'next-router-state-tree',
'next-url',
),
enableAcceptEncodingGzip: true,
enableAcceptEncodingBrotli: true,
});
// const _serverCachePolicy = new CachePolicy(stack, 'ServerCache', {
// minTtl: Duration.seconds(86400),
// defaultTtl: Duration.seconds(86400),
// headerBehavior: CacheHeaderBehavior.allowList(
// 'accept',
// 'rsc',
// 'next-router-prefetch',
// 'next-router-state-tree',
// 'next-url',
// ),
// enableAcceptEncodingGzip: true,
// enableAcceptEncodingBrotli: true,
// });
const site = new NextjsSite(stack, 'site', {
customDomain: {
domainName: domain,
Expand Down

0 comments on commit 095d336

Please sign in to comment.