List photo urls with noStore
This commit is contained in:
parent
915b71297c
commit
5f99e46cbe
@ -14,7 +14,7 @@ import {
|
||||
import { titleForPhoto } from '@/photo';
|
||||
import MorePhotos from '@/photo/MorePhotos';
|
||||
import {
|
||||
getBlobPhotoUrlsCached,
|
||||
getBlobPhotoUrlsNoStore,
|
||||
getPhotosCached,
|
||||
getPhotosCountIncludingHiddenCached,
|
||||
} from '@/cache';
|
||||
@ -45,7 +45,7 @@ export default async function AdminTagsPage({
|
||||
] = await Promise.all([
|
||||
getPhotosCached({ includeHidden: true, sortBy: 'createdAt', limit }),
|
||||
getPhotosCountIncludingHiddenCached(),
|
||||
DEBUG_PHOTO_BLOBS ? getBlobPhotoUrlsCached() : [],
|
||||
DEBUG_PHOTO_BLOBS ? getBlobPhotoUrlsNoStore() : [],
|
||||
]);
|
||||
|
||||
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) => {
|
||||
return {
|
||||
'Cache-Control': !session?.user
|
||||
|
||||
Loading…
Reference in New Issue
Block a user