From eb7092a1b196a633266dcdc1cae16d5ed346516b Mon Sep 17 00:00:00 2001 From: KONFeature Date: Fri, 13 Sep 2024 23:24:39 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Reduce=20warm=20instance?= =?UTF-8?q?=20+=20downgrade=20image=20optimisation=20lambda?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iac/DashboardWebApp.ts | 7 +++++-- iac/ExampleWebApp.ts | 14 ++++++++++---- iac/WalletWebApp.ts | 7 ++++++- packages/backend-v2 | 1 + 4 files changed, 22 insertions(+), 7 deletions(-) create mode 160000 packages/backend-v2 diff --git a/iac/DashboardWebApp.ts b/iac/DashboardWebApp.ts index 3ce186de..0043afdc 100644 --- a/iac/DashboardWebApp.ts +++ b/iac/DashboardWebApp.ts @@ -44,11 +44,14 @@ export function DashboardWebApp({ stack }: StackContext) { domainName: `${subDomain}.frak.id`.toLowerCase(), hostedZone: "frak.id", }, + // Enable image optimization + imageOptimization: { + memorySize: 512, + staticImageOptimization: true + }, // Bind to the configs bind: [...configs, reloadCampaignQueue, readPubKeyFunction], openNextVersion: openNextVersion, - // Number of server side instance to keep warm - warm: isProdStack(stack) ? 10 : 1, }); stack.addOutputs({ diff --git a/iac/ExampleWebApp.ts b/iac/ExampleWebApp.ts index 2daf3dcc..64082a73 100644 --- a/iac/ExampleWebApp.ts +++ b/iac/ExampleWebApp.ts @@ -25,13 +25,16 @@ export function ExampleAppStack({ stack }: StackContext) { // Bind to the configs bind: [nexusUrl], openNextVersion: openNextVersion, - // Number of server side instance to keep warm - warm: 10, // Set the custom domain customDomain: { domainName: "ethcc.news-paper.xyz", hostedZone: "news-paper.xyz", }, + // Enable image optimization + imageOptimization: { + memorySize: 512, + staticImageOptimization: true + }, }); // Declare the next js site on news-paper.xyz @@ -41,13 +44,16 @@ export function ExampleAppStack({ stack }: StackContext) { // Bind to the configs bind: [nexusUrl, mongoExampleUri], openNextVersion: openNextVersion, - // Number of server side instance to keep warm - warm: 10, // Set the custom domain customDomain: { domainName: "news-paper.xyz", hostedZone: "news-paper.xyz", }, + // Enable image optimization + imageOptimization: { + memorySize: 512, + staticImageOptimization: true + }, }); stack.addOutputs({ diff --git a/iac/WalletWebApp.ts b/iac/WalletWebApp.ts index c712e544..16e71c39 100644 --- a/iac/WalletWebApp.ts +++ b/iac/WalletWebApp.ts @@ -51,11 +51,16 @@ export function WalletAppStack({ stack }: StackContext) { domainName: `${subDomain}.frak.id`.toLowerCase(), hostedZone: "frak.id", }, + // Enable image optimization + imageOptimization: { + memorySize: 512, + staticImageOptimization: true + }, // Bind to the configs bind: [...configs, interactionQueue], openNextVersion: openNextVersion, // Number of server side instance to keep warm - warm: isProdStack(stack) ? 10 : 1, + warm: 1, dev: { deploy: false, }, diff --git a/packages/backend-v2 b/packages/backend-v2 new file mode 160000 index 00000000..c7b00ae7 --- /dev/null +++ b/packages/backend-v2 @@ -0,0 +1 @@ +Subproject commit c7b00ae7cdab732379463c005b2ee0777ec500ac