Do not cache the produts page and revalidate the instagram every 30 minutes
This commit is contained in:
parent
acaacfd83a
commit
08442fe306
@ -15,6 +15,7 @@ async function fetchProducts() {
|
||||
'Content-Type': 'application/json',
|
||||
'x-publishable-api-key': process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY as string,
|
||||
},
|
||||
next: { revalidate: 0 },
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
|
@ -13,7 +13,7 @@ export async function fetchInstagramPosts(): Promise<InstagramPost[]> {
|
||||
// const url = `https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,thumbnail_url,permalink&access_token=${accessToken}`;
|
||||
const url = `https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,thumbnail_url,permalink&access_token=${accessToken}`;
|
||||
|
||||
const res = await fetch(url);
|
||||
const res = await fetch(url, { next: { revalidate: 30 * 60 } });
|
||||
const data = await res.json();
|
||||
|
||||
if (data?.data) {
|
||||
|
Loading…
Reference in New Issue
Block a user