Do not cache the produts page and revalidate the instagram every 30 minutes
This commit is contained in:
@ -15,6 +15,7 @@ async function fetchProducts() {
|
|||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'x-publishable-api-key': process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY as string,
|
'x-publishable-api-key': process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY as string,
|
||||||
},
|
},
|
||||||
|
next: { revalidate: 0 },
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!response.ok) {
|
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 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();
|
const data = await res.json();
|
||||||
|
|
||||||
if (data?.data) {
|
if (data?.data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user