quidproquo-deploy-awscdk 0.0.92 → 0.0.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -185,18 +185,23 @@ class QpqWebserverWebEntryConstruct extends QpqConstructBlock_1.QpqConstructBloc
185
185
  if (seo.deprecated) {
186
186
  continue;
187
187
  }
188
- const seoCachePolicy = new aws_cdk_lib_1.aws_cloudfront.CachePolicy(this, `seo-cp-${seo.uniqueKey}`, {
189
- cachePolicyName: this.resourceName(`${props.webEntryConfig.name}-${seo.uniqueKey}`),
190
- headerBehavior: aws_cdk_lib_1.aws_cloudfront.CacheHeaderBehavior.allowList(quidproquo_webserver_1.qpqHeaderIsBot, ...seo.cache.headers),
191
- defaultTtl: cdk.Duration.seconds(seo.cache.defaultTTLInSeconds),
192
- minTtl: cdk.Duration.seconds(seo.cache.minTTLInSeconds),
193
- maxTtl: cdk.Duration.seconds(seo.cache.maxTTLInSeconds),
194
- enableAcceptEncodingGzip: true,
195
- enableAcceptEncodingBrotli: true,
196
- });
188
+ // TODO: Find a better solution for this.
189
+ // Removed this because aws limits for the number of AWS CloudFront Cache Policies in your account
190
+ // const seoCachePolicy = new aws_cloudfront.CachePolicy(this, `seo-cp-${seo.uniqueKey}`, {
191
+ // cachePolicyName: this.resourceName(`${props.webEntryConfig.name}-${seo.uniqueKey}`),
192
+ // headerBehavior: aws_cloudfront.CacheHeaderBehavior.allowList(
193
+ // qpqHeaderIsBot,
194
+ // ...seo.cache.headers,
195
+ // ),
196
+ // defaultTtl: cdk.Duration.seconds(seo.cache.defaultTTLInSeconds),
197
+ // minTtl: cdk.Duration.seconds(seo.cache.minTTLInSeconds),
198
+ // maxTtl: cdk.Duration.seconds(seo.cache.maxTTLInSeconds),
199
+ // enableAcceptEncodingGzip: true,
200
+ // enableAcceptEncodingBrotli: true,
201
+ // });
197
202
  const wildcardPath = seo.path.replaceAll(/{(.+?)}/g, '*');
198
203
  distribution.addBehavior(wildcardPath, distributionOrigin, {
199
- cachePolicy: seoCachePolicy,
204
+ // cachePolicy: seoCachePolicy,
200
205
  viewerProtocolPolicy: aws_cdk_lib_1.aws_cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
201
206
  compress: props.webEntryConfig.compressFiles,
202
207
  responseHeadersPolicy: responseHeaderPolicy,
@@ -213,25 +218,33 @@ class QpqWebserverWebEntryConstruct extends QpqConstructBlock_1.QpqConstructBloc
213
218
  });
214
219
  }
215
220
  }
216
- const ignoreCacheResponseHeaderPolicy = new aws_cdk_lib_1.aws_cloudfront.ResponseHeadersPolicy(this, `dist-rhp-ignore`, {
217
- responseHeadersPolicyName: this.qpqResourceName(props.webEntryConfig.name, 'ignore'),
218
- customHeadersBehavior: {
219
- customHeaders: [
220
- {
221
- header: 'Cache-Control',
222
- value: `max-age=300, must-revalidate`,
223
- override: true,
224
- },
225
- ],
226
- },
227
- securityHeadersBehavior: (0, securityHeaders_1.convertSecurityHeadersFromQpqSecurityHeaders)(quidproquo_webserver_1.qpqWebServerUtils.getBaseDomainName(props.qpqConfig), props.webEntryConfig.securityHeaders),
228
- });
221
+ // Removed this because aws limits for the number of AWS CloudFront Cache Policies in your account
222
+ // const ignoreCacheResponseHeaderPolicy = new aws_cloudfront.ResponseHeadersPolicy(
223
+ // this,
224
+ // `dist-rhp-ignore`,
225
+ // {
226
+ // responseHeadersPolicyName: this.qpqResourceName(props.webEntryConfig.name, 'ignore'),
227
+ // customHeadersBehavior: {
228
+ // customHeaders: [
229
+ // {
230
+ // header: 'Cache-Control',
231
+ // value: `max-age=300, must-revalidate`,
232
+ // override: true,
233
+ // },
234
+ // ],
235
+ // },
236
+ // securityHeadersBehavior: convertSecurityHeadersFromQpqSecurityHeaders(
237
+ // qpqWebServerUtils.getBaseDomainName(props.qpqConfig),
238
+ // props.webEntryConfig.securityHeaders,
239
+ // ),
240
+ // },
241
+ // );
229
242
  props.webEntryConfig.ignoreCache.forEach((pathPattern) => {
230
243
  distribution.addBehavior(pathPattern, distributionOrigin, {
231
244
  cachePolicy: aws_cdk_lib_1.aws_cloudfront.CachePolicy.CACHING_DISABLED,
232
245
  viewerProtocolPolicy: aws_cdk_lib_1.aws_cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
233
246
  compress: props.webEntryConfig.compressFiles,
234
- responseHeadersPolicy: ignoreCacheResponseHeaderPolicy,
247
+ // responseHeadersPolicy: ignoreCacheResponseHeaderPolicy,
235
248
  });
236
249
  });
237
250
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-deploy-awscdk",
3
- "version": "0.0.92",
3
+ "version": "0.0.93",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.js",
@@ -256,22 +256,24 @@ export class QpqWebserverWebEntryConstruct extends QpqConstructBlock {
256
256
  continue;
257
257
  }
258
258
 
259
- const seoCachePolicy = new aws_cloudfront.CachePolicy(this, `seo-cp-${seo.uniqueKey}`, {
260
- cachePolicyName: this.resourceName(`${props.webEntryConfig.name}-${seo.uniqueKey}`),
261
- headerBehavior: aws_cloudfront.CacheHeaderBehavior.allowList(
262
- qpqHeaderIsBot,
263
- ...seo.cache.headers,
264
- ),
265
- defaultTtl: cdk.Duration.seconds(seo.cache.defaultTTLInSeconds),
266
- minTtl: cdk.Duration.seconds(seo.cache.minTTLInSeconds),
267
- maxTtl: cdk.Duration.seconds(seo.cache.maxTTLInSeconds),
268
- enableAcceptEncodingGzip: true,
269
- enableAcceptEncodingBrotli: true,
270
- });
259
+ // TODO: Find a better solution for this.
260
+ // Removed this because aws limits for the number of AWS CloudFront Cache Policies in your account
261
+ // const seoCachePolicy = new aws_cloudfront.CachePolicy(this, `seo-cp-${seo.uniqueKey}`, {
262
+ // cachePolicyName: this.resourceName(`${props.webEntryConfig.name}-${seo.uniqueKey}`),
263
+ // headerBehavior: aws_cloudfront.CacheHeaderBehavior.allowList(
264
+ // qpqHeaderIsBot,
265
+ // ...seo.cache.headers,
266
+ // ),
267
+ // defaultTtl: cdk.Duration.seconds(seo.cache.defaultTTLInSeconds),
268
+ // minTtl: cdk.Duration.seconds(seo.cache.minTTLInSeconds),
269
+ // maxTtl: cdk.Duration.seconds(seo.cache.maxTTLInSeconds),
270
+ // enableAcceptEncodingGzip: true,
271
+ // enableAcceptEncodingBrotli: true,
272
+ // });
271
273
 
272
274
  const wildcardPath = seo.path.replaceAll(/{(.+?)}/g, '*');
273
275
  distribution.addBehavior(wildcardPath, distributionOrigin, {
274
- cachePolicy: seoCachePolicy,
276
+ // cachePolicy: seoCachePolicy,
275
277
  viewerProtocolPolicy: aws_cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
276
278
  compress: props.webEntryConfig.compressFiles,
277
279
  responseHeadersPolicy: responseHeaderPolicy,
@@ -289,33 +291,34 @@ export class QpqWebserverWebEntryConstruct extends QpqConstructBlock {
289
291
  }
290
292
  }
291
293
 
292
- const ignoreCacheResponseHeaderPolicy = new aws_cloudfront.ResponseHeadersPolicy(
293
- this,
294
- `dist-rhp-ignore`,
295
- {
296
- responseHeadersPolicyName: this.qpqResourceName(props.webEntryConfig.name, 'ignore'),
297
- customHeadersBehavior: {
298
- customHeaders: [
299
- {
300
- header: 'Cache-Control',
301
- value: `max-age=300, must-revalidate`,
302
- override: true,
303
- },
304
- ],
305
- },
306
- securityHeadersBehavior: convertSecurityHeadersFromQpqSecurityHeaders(
307
- qpqWebServerUtils.getBaseDomainName(props.qpqConfig),
308
- props.webEntryConfig.securityHeaders,
309
- ),
310
- },
311
- );
294
+ // Removed this because aws limits for the number of AWS CloudFront Cache Policies in your account
295
+ // const ignoreCacheResponseHeaderPolicy = new aws_cloudfront.ResponseHeadersPolicy(
296
+ // this,
297
+ // `dist-rhp-ignore`,
298
+ // {
299
+ // responseHeadersPolicyName: this.qpqResourceName(props.webEntryConfig.name, 'ignore'),
300
+ // customHeadersBehavior: {
301
+ // customHeaders: [
302
+ // {
303
+ // header: 'Cache-Control',
304
+ // value: `max-age=300, must-revalidate`,
305
+ // override: true,
306
+ // },
307
+ // ],
308
+ // },
309
+ // securityHeadersBehavior: convertSecurityHeadersFromQpqSecurityHeaders(
310
+ // qpqWebServerUtils.getBaseDomainName(props.qpqConfig),
311
+ // props.webEntryConfig.securityHeaders,
312
+ // ),
313
+ // },
314
+ // );
312
315
 
313
316
  props.webEntryConfig.ignoreCache.forEach((pathPattern) => {
314
317
  distribution.addBehavior(pathPattern, distributionOrigin, {
315
318
  cachePolicy: aws_cloudfront.CachePolicy.CACHING_DISABLED,
316
319
  viewerProtocolPolicy: aws_cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
317
320
  compress: props.webEntryConfig.compressFiles,
318
- responseHeadersPolicy: ignoreCacheResponseHeaderPolicy,
321
+ // responseHeadersPolicy: ignoreCacheResponseHeaderPolicy,
319
322
  });
320
323
  });
321
324
  }