diff --git a/src/app/(static)/grid/page.tsx b/src/app/(static)/grid/page.tsx index 39f7b2dd..73af56ec 100644 --- a/src/app/(static)/grid/page.tsx +++ b/src/app/(static)/grid/page.tsx @@ -8,8 +8,7 @@ import { getPhotos, getPhotosCount, getUniqueTags } from '@/services/postgres'; import PhotoTag from '@/tag/PhotoTag'; import { Metadata } from 'next'; -// Revalidate every 12 hours -export const revalidate = 43_200; +export const runtime = 'edge'; export async function generateMetadata(): Promise { const photos = await getPhotos(); diff --git a/src/app/(static)/p/[photoId]/layout.tsx b/src/app/(static)/p/[photoId]/layout.tsx index 25e815cf..daa2200a 100644 --- a/src/app/(static)/p/[photoId]/layout.tsx +++ b/src/app/(static)/p/[photoId]/layout.tsx @@ -6,7 +6,6 @@ import { import { Metadata } from 'next'; import { getPhoto, - getPhotos, getPhotosTakenAfterPhotoInclusive, getPhotosTakenBeforePhoto, } from '@/services/postgres'; @@ -14,15 +13,7 @@ import { redirect } from 'next/navigation'; import { absolutePathForPhoto, absolutePathForPhotoImage } from '@/site/paths'; import PhotoDetailPage from '@/photo/PhotoDetailPage'; -// Revalidate every 12 hours -export const revalidate = 43_200; - -export async function generateStaticParams() { - const photos = await getPhotos(); - return photos.map(photo => ({ - slug: photo.id, - })); -} +export const runtime = 'edge'; export async function generateMetadata({ params: { photoId }, diff --git a/src/app/(static)/page.tsx b/src/app/(static)/page.tsx index 2dc3e294..22ccedd0 100644 --- a/src/app/(static)/page.tsx +++ b/src/app/(static)/page.tsx @@ -7,8 +7,7 @@ import PhotosEmptyState from '@/photo/PhotosEmptyState'; import { getPhotos, getPhotosCount } from '@/services/postgres'; import { Metadata } from 'next'; -// Revalidate every 12 hours -export const revalidate = 43_200; +export const runtime = 'edge'; export async function generateMetadata(): Promise { const photos = await getPhotos();