feat: tag all PocketBase fetches for ISR cache invalidation
Each getCollection/getFirstRecord call now passes the collection name as a cache tag so revalidateTag can target individual collections.
This commit is contained in:
@@ -10,6 +10,7 @@ import { SectionsAccordion } from '$widgets/SectionsAccordion';
|
||||
export async function generateStaticParams() {
|
||||
const { items: sections } = await getCollection<SectionRecord>('sections', {
|
||||
sort: 'order',
|
||||
tags: ['sections'],
|
||||
});
|
||||
return [{}, ...sections.map((s) => ({ slug: [s.slug] }))];
|
||||
}
|
||||
@@ -26,6 +27,7 @@ export default async function SectionPage({ params }: Props) {
|
||||
|
||||
const { items: sections } = await getCollection<SectionRecord>('sections', {
|
||||
sort: 'order',
|
||||
tags: ['sections'],
|
||||
});
|
||||
|
||||
if (sections.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user