Temporarily remove caching from [photoId]
This commit is contained in:
parent
ad4d35531d
commit
1e6f517515
@ -1,8 +1,9 @@
|
||||
// import { auth } from '@/auth';
|
||||
// import { getImageCacheHeadersForAuth, getPhotoCached } from '@/cache';
|
||||
import { getPhotoCached } from '@/cache';
|
||||
// import { getPhotoCached } from '@/cache';
|
||||
import { IMAGE_OG_DIMENSION } from '@/photo/image-response';
|
||||
import PhotoImageResponse from '@/photo/image-response/PhotoImageResponse';
|
||||
import { getPhoto } from '@/services/vercel-postgres';
|
||||
import { getIBMPlexMonoMedium } from '@/site/font';
|
||||
import { ImageResponse } from 'next/og';
|
||||
|
||||
@ -17,7 +18,7 @@ export async function GET(
|
||||
{ fontFamily, fonts },
|
||||
// headers,
|
||||
] = await Promise.all([
|
||||
getPhotoCached(context.params.photoId),
|
||||
getPhoto(context.params.photoId),
|
||||
getIBMPlexMonoMedium(),
|
||||
// getImageCacheHeadersForAuth(await auth()),
|
||||
]);
|
||||
|
||||
@ -12,8 +12,12 @@ import {
|
||||
absolutePathForPhotoImage,
|
||||
} from '@/site/paths';
|
||||
import PhotoDetailPage from '@/photo/PhotoDetailPage';
|
||||
import { getPhotoCached, getPhotosNearIdCached } from '@/cache';
|
||||
import { getPhotoIds } from '@/services/vercel-postgres';
|
||||
// import { getPhotoCached, getPhotosNearIdCached } from '@/cache';
|
||||
import {
|
||||
getPhoto,
|
||||
getPhotoIds,
|
||||
getPhotosNearId,
|
||||
} from '@/services/vercel-postgres';
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const photos = await getPhotoIds({ limit: 10 });
|
||||
@ -27,7 +31,7 @@ interface PhotoProps {
|
||||
export async function generateMetadata({
|
||||
params: { photoId },
|
||||
}:PhotoProps): Promise<Metadata> {
|
||||
const photo = await getPhotoCached(photoId);
|
||||
const photo = await getPhoto(photoId);
|
||||
|
||||
if (!photo) { return {}; }
|
||||
|
||||
@ -58,7 +62,7 @@ export default async function PhotoPage({
|
||||
params: { photoId },
|
||||
children,
|
||||
}: PhotoProps & { children: React.ReactNode }) {
|
||||
const photos = await getPhotosNearIdCached(
|
||||
const photos = await getPhotosNearId(
|
||||
photoId,
|
||||
GRID_THUMBNAILS_TO_SHOW_MAX + 2,
|
||||
);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { getPhotoCached } from '@/cache';
|
||||
import PhotoShareModal from '@/photo/PhotoShareModal';
|
||||
import { getPhoto } from '@/services/vercel-postgres';
|
||||
import { PATH_ROOT } from '@/site/paths';
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
@ -8,7 +8,7 @@ export default async function Share({
|
||||
}: {
|
||||
params: { photoId: string }
|
||||
}) {
|
||||
const photo = await getPhotoCached(photoId);
|
||||
const photo = await getPhoto(photoId);
|
||||
|
||||
if (!photo) { return redirect(PATH_ROOT); }
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user