From ce43c7359ddaec112def789d152e32c2b1e06167 Mon Sep 17 00:00:00 2001 From: Francesco Sansalvadore Date: Tue, 28 Mar 2023 12:58:17 +0200 Subject: [PATCH] lw7: uncomment cache on functions --- .../supabase/functions/lw7-ticket-gallery/handler.tsx | 6 +++--- apps/www/supabase/functions/lw7-ticket-og/handler.tsx | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/www/supabase/functions/lw7-ticket-gallery/handler.tsx b/apps/www/supabase/functions/lw7-ticket-gallery/handler.tsx index 853372d34f4..4947b1c5c19 100644 --- a/apps/www/supabase/functions/lw7-ticket-gallery/handler.tsx +++ b/apps/www/supabase/functions/lw7-ticket-gallery/handler.tsx @@ -185,8 +185,8 @@ export async function handler(req: Request) { ], headers: { 'content-type': 'image/png', - // 'cache-control': 'public, max-age=31536000, s-maxage=31536000, no-transform, immutable', - // 'cdn-cache-control': 'max-age=31536000', + 'cache-control': 'public, max-age=31536000, s-maxage=31536000, no-transform, immutable', + 'cdn-cache-control': 'max-age=31536000', }, } ) @@ -207,7 +207,7 @@ export async function handler(req: Request) { generatedImage.body!, { contentType: 'image/png', - // cacheControl: '31536000', + cacheControl: '31536000', upsert: true, } ) diff --git a/apps/www/supabase/functions/lw7-ticket-og/handler.tsx b/apps/www/supabase/functions/lw7-ticket-og/handler.tsx index 494a1e6aea1..0991d3333ac 100644 --- a/apps/www/supabase/functions/lw7-ticket-og/handler.tsx +++ b/apps/www/supabase/functions/lw7-ticket-og/handler.tsx @@ -69,12 +69,12 @@ export async function handler(req: Request) { const BACKGROUND = { REG: { BG: `${STORAGE_URL}/reg_bg.png`, - AI: `${STORAGE_URL}/tickets_bg/blurred/regular/png/reg_bg_${bg_image_id}.png`, + AI: `${STORAGE_URL}/tickets_bg/blurred/regular/png/reg_bg_${bg_image_id ?? '1'}.png`, TICKET: `${STORAGE_URL}/reg_ticket.png`, }, GOLD: { BG: `${STORAGE_URL}/gold_bg.png`, - AI: `${STORAGE_URL}/tickets_bg/blurred/golden/png/gold_bg_${bg_image_id}.png`, + AI: `${STORAGE_URL}/tickets_bg/blurred/golden/png/gold_bg_${bg_image_id ?? '1'}.png`, TICKET: `${STORAGE_URL}/gold_ticket.png`, }, } @@ -238,8 +238,8 @@ export async function handler(req: Request) { ], headers: { 'content-type': 'image/png', - // 'cache-control': 'public, max-age=31536000, s-maxage=31536000, no-transform, immutable', - // 'cdn-cache-control': 'max-age=31536000', + 'cache-control': 'public, max-age=31536000, s-maxage=31536000, no-transform, immutable', + 'cdn-cache-control': 'max-age=31536000', }, } ) @@ -252,7 +252,7 @@ export async function handler(req: Request) { generatedImage.body!, { contentType: 'image/png', - // cacheControl: '31536000', + cacheControl: '31536000', upsert: false, } )