Hey @KAn , I'm sorry you're having trouble with the APIs. Could you tell me a bit more about your situation? I don't understand what you're trying to accomplish and what is happening.
Do you mean that the content from the API gets stuck and when you publish new content it's still fetching the old content?
Or is it that you're trying to update your custom types with the Custom types API but you're not seeing those changes take effect?
Considering you're not using slice machine, knowing more about your setup would help us help you better :)
How do I make sure this?
All I want to do is connecting the data from Prismic so that whenever I change the content in Prismic, the data in my code changes accordingly.
Did I set up wrong?
You will also need a way to revalidate all Prismic requests when content changes. Here is an excerpt from an upcoming update to our documentation:
Add a webhook to clear the Next.js fetch() cache when your content changes in Prismic. Follow the Create a webhook instructions in our webhooks documentation using these values:
Name: Next.js on-demand revalidation
URL: Your app’s deployed URL + /api/revalidate (example: https://example.com/api/revalidate)
Triggers: Only check “A document is published” and “A document is unpublished”
You do not need to set up a webhook with your hosting provider.
Apps bootstrapped using a Prismic starter or @slicemachine/init include the following /api/revalidate Route Handler.
// app/api/revalidate/route.ts
import { NextResponse } from "next/server";
import { revalidateTag } from "next/cache";
export async function POST() {
revalidateTag("prismic");
return NextResponse.json({ revalidated: true, now: Date.now() });
}