mirror of
https://github.com/vercel/commerce.git
synced 2025-05-20 08:26:59 +00:00
fix: remove revalidate from cart requests
This commit is contained in:
parent
cd2db81bbb
commit
46395206b6
@ -5,7 +5,7 @@ import { notFound } from 'next/navigation';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
export const revalidate = 43200; // 12 hours in seconds
|
||||
export const revalidate = parseInt(process.env.REVALIDATE_WINDOW ?? `${60 * 60 * 12}`); // 12 hours
|
||||
|
||||
export async function generateMetadata({
|
||||
params
|
||||
|
@ -6,7 +6,6 @@ import Grid from 'components/grid';
|
||||
import ProductGridItems from 'components/layout/product-grid-items';
|
||||
|
||||
export const runtime = 'edge';
|
||||
export const revalidate = 30;
|
||||
|
||||
export async function generateMetadata({
|
||||
params
|
||||
|
@ -33,10 +33,13 @@ export default async function medusaRequest(
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'x-publishable-key': MEDUSA_API_KEY
|
||||
},
|
||||
next: { revalidate: REVALIDATE_WINDOW }
|
||||
}
|
||||
};
|
||||
|
||||
if (!path.includes('/carts')) {
|
||||
options.next = { revalidate: REVALIDATE_WINDOW };
|
||||
}
|
||||
|
||||
if (payload) {
|
||||
options.body = JSON.stringify(payload);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user