Revert to non-static edge functions

This commit is contained in:
Sam Becker 2023-09-20 14:58:09 -05:00
parent 57c137cee6
commit 9db85f5944
3 changed files with 3 additions and 14 deletions

View File

@ -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<Metadata> {
const photos = await getPhotos();

View File

@ -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 },

View File

@ -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<Metadata> {
const photos = await getPhotos();