Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(infra): reduce cache keys below 10 to prevent deployment errors #3332

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Wentao-Kuang marked this conversation as resolved.
Show resolved Hide resolved
queryStringCacheKeys: ['config', 'exclude', 'tileMatrix', 'style', 'pipeline', 'terrain'].map(
encodeURIComponent,
),
},
lambdaFunctionAssociations: [],
},
Expand Down
Loading