Skip to content

Commit

Permalink
fix(infra): reduce cache keys below 10 to prevent deployment errors
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha committed Aug 26, 2024
1 parent 89e72ea commit 02f806d
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions packages/_infra/src/edge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,36 +97,30 @@ export class EdgeStack extends cdk.Stack {
originProtocolPolicy: cf.OriginProtocolPolicy.HTTPS_ONLY,
},
behaviors: [
// Configuration for all lambda requests
// Only the tiles themselves are cached so only things affecting tile rendering should be a cacheKey
{
pathPattern: '/v1*',
allowedMethods: cf.CloudFrontAllowedMethods.ALL,
forwardedValues: {
/** Forward all query strings but do not use them for caching */
queryString: true,
queryStringCacheKeys: ['config', 'exclude', 'pipeline', 'terrain'].map(encodeURIComponent),
// queryStringCacheKeys are limited to a max of 10
queryStringCacheKeys: ['config', 'exclude', 'pipeline'].map(encodeURIComponent),
},
lambdaFunctionAssociations: [],
},
// Configuration for static landing page, used when rendering preview images for things like slack
{
pathPattern: '/@*',
allowedMethods: cf.CloudFrontAllowedMethods.ALL,
forwardedValues: {
/** Forward all query strings but do not use them for caching */
queryString: true,
queryStringCacheKeys: [
'config',
'exclude',
'tileMatrix',
'style',
'pipeline',
'terrain',
'labels',
// Deprecated single character query params for style and projection
's',
'p',
'i', // ?i=:imageryId is deprecated and should be removed at some point
't',
].map(encodeURIComponent),
// queryStringCacheKeys are limited to a max of 10
queryStringCacheKeys: ['config', 'exclude', 'tileMatrix', 'style', 'pipeline', 'terrain'].map(
encodeURIComponent,
),
},
lambdaFunctionAssociations: [],
},
Expand Down

0 comments on commit 02f806d

Please sign in to comment.