From c189e567b87d0e2977941e060ba9ff9a4f47664d Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sat, 28 Jun 2025 13:44:35 -0500 Subject: [PATCH] Conditionally pre-render /recents image --- app/recents/image/route.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/recents/image/route.tsx b/app/recents/image/route.tsx index 4402caed..c9f9eb28 100644 --- a/app/recents/image/route.tsx +++ b/app/recents/image/route.tsx @@ -9,6 +9,7 @@ import { getIBMPlexMono } from '@/app/font'; import { ImageResponse } from 'next/og'; import { getImageResponseCacheControlHeaders } from '@/image-response/cache'; import { getAppText } from '@/i18n/state/server'; +import { SHOW_RECENTS } from '@/app/config'; export const dynamic = 'force-static'; @@ -18,10 +19,12 @@ export async function GET() { { fontFamily, fonts }, headers, ] = await Promise.all([ - getPhotosCached({ - limit: MAX_PHOTOS_TO_SHOW_PER_CATEGORY, - recent: true, - }), + SHOW_RECENTS + ? getPhotosCached({ + limit: MAX_PHOTOS_TO_SHOW_PER_CATEGORY, + recent: true, + }) + : [], getIBMPlexMono(), getImageResponseCacheControlHeaders(), ]); @@ -42,4 +45,4 @@ export async function GET() { }}/>, { width, height, fonts, headers }, ); -} \ No newline at end of file +}