Conditionally pre-render /recents image
This commit is contained in:
parent
722f18cc0f
commit
c189e567b8
@ -9,6 +9,7 @@ import { getIBMPlexMono } from '@/app/font';
|
|||||||
import { ImageResponse } from 'next/og';
|
import { ImageResponse } from 'next/og';
|
||||||
import { getImageResponseCacheControlHeaders } from '@/image-response/cache';
|
import { getImageResponseCacheControlHeaders } from '@/image-response/cache';
|
||||||
import { getAppText } from '@/i18n/state/server';
|
import { getAppText } from '@/i18n/state/server';
|
||||||
|
import { SHOW_RECENTS } from '@/app/config';
|
||||||
|
|
||||||
export const dynamic = 'force-static';
|
export const dynamic = 'force-static';
|
||||||
|
|
||||||
@ -18,10 +19,12 @@ export async function GET() {
|
|||||||
{ fontFamily, fonts },
|
{ fontFamily, fonts },
|
||||||
headers,
|
headers,
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
getPhotosCached({
|
SHOW_RECENTS
|
||||||
|
? getPhotosCached({
|
||||||
limit: MAX_PHOTOS_TO_SHOW_PER_CATEGORY,
|
limit: MAX_PHOTOS_TO_SHOW_PER_CATEGORY,
|
||||||
recent: true,
|
recent: true,
|
||||||
}),
|
})
|
||||||
|
: [],
|
||||||
getIBMPlexMono(),
|
getIBMPlexMono(),
|
||||||
getImageResponseCacheControlHeaders(),
|
getImageResponseCacheControlHeaders(),
|
||||||
]);
|
]);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user