Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions platform/wab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
"@amplitude/analytics-browser": "2.11.1",
"@amplitude/analytics-node": "1.3.6",
"@apidevtools/swagger-parser": "^10.0.2",
"@aws-sdk/client-cloudfront": "^3.319.0",
"@aws-sdk/client-dynamodb": "^3.319.0",
"@babel/core": "^7.28.4",
"@babel/generator": "^7.28.3",
Expand Down Expand Up @@ -275,6 +276,7 @@
"css-tree": "^3.1.0",
"css.escape": "^1.5.1",
"dayjs": "^1.11.9",
"dd-trace": "^5.0.0",
"debug": "2.6.9",
"dom-align": "^1.12.0",
"dotenv": "^8.2.0",
Expand Down
19 changes: 19 additions & 0 deletions platform/wab/src/wab/server/AppServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,25 @@ export function addLoaderRoutes(app: express.Application) {
apiAuth,
withNext(buildPublishedLoaderAssets)
);
// A CloudFront Function (viewer-request) rewrites published requests to embed
// sorted base project IDs into the URL path before CloudFront caches the
// response, e.g.:
// /api/v1/loader/code/published?projectId=zzz&projectId=aaa&platform=react
// → /api/v1/loader/code/published/aaa,zzz?projectId=zzz&projectId=aaa&...
//
// This makes CloudFront cache entries addressable per-project so that
// CreateInvalidation can target /published/{projectIds}* on publish rather
// than wiping the cache for all projects at once.
//
// The :projectIds path segment is intentionally ignored here — the handler
// reads projectId from the query string as normal, which the CF Function
// preserves verbatim.
app.get(
"/api/v1/loader/code/published/:projectIds",
cors(),
apiAuth,
withNext(buildPublishedLoaderAssets)
);
app.get(
"/api/v1/loader/code/versioned",
cors(),
Expand Down
Loading
Loading