mirror of
https://github.com/vercel/commerce.git
synced 2025-05-14 21:47:51 +00:00
add revalidation timeframes
This commit is contained in:
parent
787d7e7912
commit
1d83ea4042
@ -9,6 +9,8 @@ import { Suspense } from 'react';
|
|||||||
import AboutNaraiDetail from './about-narai-detail';
|
import AboutNaraiDetail from './about-narai-detail';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
export const revalidate = 43200; // 12 hours in seconds
|
||||||
|
|
||||||
const { SITE_NAME } = process.env;
|
const { SITE_NAME } = process.env;
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
|
@ -27,6 +27,8 @@ import Image from 'next/image';
|
|||||||
import { Suspense } from 'react';
|
import { Suspense } from 'react';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
export const revalidate = 300; // 5 minutes in seconds
|
||||||
|
|
||||||
const { SITE_NAME } = process.env;
|
const { SITE_NAME } = process.env;
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
|
@ -7,6 +7,8 @@ import { cookies } from 'next/headers';
|
|||||||
import { ReactNode, Suspense } from 'react';
|
import { ReactNode, Suspense } from 'react';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
export const revalidate = 300; // 5 minutes in seconds
|
||||||
|
|
||||||
const { SITE_NAME } = process.env;
|
const { SITE_NAME } = process.env;
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
|
@ -19,7 +19,7 @@ import Image from 'next/image';
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
export const revalidate = 43200; // 12 hours in seconds
|
export const revalidate = 300; // 5 minutes in seconds
|
||||||
|
|
||||||
export async function generateMetadata({
|
export async function generateMetadata({
|
||||||
params
|
params
|
||||||
|
@ -9,7 +9,7 @@ import { cookies } from 'next/headers';
|
|||||||
import { Suspense } from 'react';
|
import { Suspense } from 'react';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
export const revalidate = 43200; // 12 hours in seconds
|
export const revalidate = 300; // 5 minutes in seconds
|
||||||
|
|
||||||
const { SITE_NAME } = process.env;
|
const { SITE_NAME } = process.env;
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ import OpengraphImage from 'components/opengraph-image';
|
|||||||
import { getPage } from 'lib/shopify';
|
import { getPage } from 'lib/shopify';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
export const revalidate = 300; // 5 minutes in seconds
|
||||||
|
|
||||||
export default async function Image({ params }: { params: { page: string } }) {
|
export default async function Image({ params }: { params: { page: string } }) {
|
||||||
const page = await getPage({ handle: params.page });
|
const page = await getPage({ handle: params.page });
|
||||||
|
@ -12,8 +12,7 @@ import { Suspense } from 'react';
|
|||||||
import ShopsNav from './shops-nav';
|
import ShopsNav from './shops-nav';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
export const revalidate = 300; // 5 minutes in seconds
|
||||||
export const revalidate = 43200; // 12 hours in seconds
|
|
||||||
|
|
||||||
export async function generateMetadata({
|
export async function generateMetadata({
|
||||||
params
|
params
|
||||||
|
@ -8,6 +8,8 @@ import { cookies } from 'next/headers';
|
|||||||
import { ReactNode, Suspense } from 'react';
|
import { ReactNode, Suspense } from 'react';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
export const revalidate = 300; // 5 minutes in seconds
|
||||||
|
|
||||||
const { SITE_NAME } = process.env;
|
const { SITE_NAME } = process.env;
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
|
@ -7,7 +7,9 @@ import { BLOG_HANDLE, HIDDEN_ARTICLE_TAG } from 'lib/constants';
|
|||||||
import { getBlogArticle } from 'lib/shopify';
|
import { getBlogArticle } from 'lib/shopify';
|
||||||
import { BlogArticle } from 'lib/shopify/types';
|
import { BlogArticle } from 'lib/shopify/types';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
export const revalidate = 300; // 5 minutes in seconds
|
||||||
|
|
||||||
export async function generateMetadata({
|
export async function generateMetadata({
|
||||||
params
|
params
|
||||||
|
@ -10,6 +10,8 @@ import { cookies } from 'next/headers';
|
|||||||
import { Suspense } from 'react';
|
import { Suspense } from 'react';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
export const revalidate = 300; // 5 minutes in seconds
|
||||||
|
|
||||||
const { SITE_NAME } = process.env;
|
const { SITE_NAME } = process.env;
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
|
@ -9,6 +9,8 @@ import { Suspense } from 'react';
|
|||||||
import TermsOfUse from './terms-of-use';
|
import TermsOfUse from './terms-of-use';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
export const revalidate = 43200; // 12 hours in seconds
|
||||||
|
|
||||||
const { SITE_NAME } = process.env;
|
const { SITE_NAME } = process.env;
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
|
@ -2,6 +2,7 @@ import OpengraphImage from 'components/opengraph-image';
|
|||||||
import { getPage } from 'lib/shopify';
|
import { getPage } from 'lib/shopify';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
export const revalidate = 300; // 5 minutes in seconds
|
||||||
|
|
||||||
export default async function Image({ params }: { params: { page: string } }) {
|
export default async function Image({ params }: { params: { page: string } }) {
|
||||||
const page = await getPage({ handle: params.page });
|
const page = await getPage({ handle: params.page });
|
||||||
|
@ -5,8 +5,7 @@ import Prose from 'components/prose';
|
|||||||
import { getPage } from 'lib/shopify';
|
import { getPage } from 'lib/shopify';
|
||||||
import { notFound } from 'next/navigation';
|
import { notFound } from 'next/navigation';
|
||||||
|
|
||||||
// export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
|
||||||
export const revalidate = 43200; // 12 hours in seconds
|
export const revalidate = 43200; // 12 hours in seconds
|
||||||
|
|
||||||
export async function generateMetadata({
|
export async function generateMetadata({
|
||||||
|
@ -2,6 +2,7 @@ import OpengraphImage from 'components/opengraph-image';
|
|||||||
import { getCollection } from 'lib/shopify';
|
import { getCollection } from 'lib/shopify';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
export const revalidate = 300; // 5 minutes in seconds
|
||||||
|
|
||||||
export default async function Image({ params }: { params: { collection: string } }) {
|
export default async function Image({ params }: { params: { collection: string } }) {
|
||||||
const collection = await getCollection({ handle: params.collection });
|
const collection = await getCollection({ handle: params.collection });
|
||||||
|
@ -7,6 +7,7 @@ import ProductGridItems from 'components/layout/product-grid-items';
|
|||||||
import { defaultSort, sorting } from 'lib/constants';
|
import { defaultSort, sorting } from 'lib/constants';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
export const revalidate = 300; // 5 minutes in seconds
|
||||||
|
|
||||||
export async function generateMetadata({
|
export async function generateMetadata({
|
||||||
params
|
params
|
||||||
|
@ -4,6 +4,7 @@ import { defaultSort, sorting } from 'lib/constants';
|
|||||||
import { getProducts } from 'lib/shopify';
|
import { getProducts } from 'lib/shopify';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
export const revalidate = 300; // 5 minutes in seconds
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
title: 'Search',
|
title: 'Search',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user