arnez2323
TTCTheo's Typesafe Cult
•Created by arnez2323 on 9/15/2023 in #questions
Problem with Sanity and Next js
created Sanity project it works great when I fetch but it is not updating in real time is there a thing with Next like special caching stuff. When I useCdn it changes but it is not up to date even if I refresh 10 times. Here is the code:
import { createClient, groq } from "next-sanity";
export async function getPosts() {
const client = createClient({
projectId: "MY ID",
dataset: "production",
apiVersion: "2023-09-15",
useCdn: false,
});
return client.fetch(groq*[_type == "post"]{
_id,
_createdAt,
title,
"slug": slug.current,
publishedAt,
author,
"mainImage": mainImage.asset->url,
body
});
}
2 replies
TTCTheo's Typesafe Cult
•Created by arnez2323 on 9/15/2023 in #questions
Slow load time
Any idea how to block admin page from loading to users because it makes my website slow
5 replies