List photo urls with noStore
This commit is contained in:
parent
915b71297c
commit
5f99e46cbe
@ -14,7 +14,7 @@ import {
|
|||||||
import { titleForPhoto } from '@/photo';
|
import { titleForPhoto } from '@/photo';
|
||||||
import MorePhotos from '@/photo/MorePhotos';
|
import MorePhotos from '@/photo/MorePhotos';
|
||||||
import {
|
import {
|
||||||
getBlobPhotoUrlsCached,
|
getBlobPhotoUrlsNoStore,
|
||||||
getPhotosCached,
|
getPhotosCached,
|
||||||
getPhotosCountIncludingHiddenCached,
|
getPhotosCountIncludingHiddenCached,
|
||||||
} from '@/cache';
|
} from '@/cache';
|
||||||
@ -45,7 +45,7 @@ export default async function AdminTagsPage({
|
|||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
getPhotosCached({ includeHidden: true, sortBy: 'createdAt', limit }),
|
getPhotosCached({ includeHidden: true, sortBy: 'createdAt', limit }),
|
||||||
getPhotosCountIncludingHiddenCached(),
|
getPhotosCountIncludingHiddenCached(),
|
||||||
DEBUG_PHOTO_BLOBS ? getBlobPhotoUrlsCached() : [],
|
DEBUG_PHOTO_BLOBS ? getBlobPhotoUrlsNoStore() : [],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const showMorePhotos = count > photos.length;
|
const showMorePhotos = count > photos.length;
|
||||||
|
|||||||
5
src/cache/index.ts
vendored
5
src/cache/index.ts
vendored
@ -276,6 +276,11 @@ export const getBlobPhotoUrlsCached: typeof getBlobPhotoUrls = (...args) =>
|
|||||||
}
|
}
|
||||||
)();
|
)();
|
||||||
|
|
||||||
|
export const getBlobPhotoUrlsNoStore: typeof getBlobPhotoUrls = (...args) => {
|
||||||
|
unstable_noStore();
|
||||||
|
return getBlobPhotoUrls(...args);
|
||||||
|
};
|
||||||
|
|
||||||
export const getImageCacheHeadersForAuth = (session: Session | null) => {
|
export const getImageCacheHeadersForAuth = (session: Session | null) => {
|
||||||
return {
|
return {
|
||||||
'Cache-Control': !session?.user
|
'Cache-Control': !session?.user
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user