Skip to content

Commit

Permalink
Merge branch 'master' of github.com:BuilderIO/nextjs-shopify
Browse files Browse the repository at this point in the history
* 'master' of github.com:BuilderIO/nextjs-shopify:
  Lower revalidation timeout to 5 seconds
  removed cachebust option (vercel#22)
  • Loading branch information
teleaziz committed Nov 3, 2021
2 parents 1a1934d + bfa62aa commit 620d944
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/cart/CartSidebarView/CartSidebarView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const CartSidebarView: FC = () => {
const items = cart?.lineItems || []
const cartUpsellContent = await builder
.get('cart-upsell-sidebar', {
cachebust: env.isDev,
cacheSeconds: 120,
userAttributes: {
itemInCart: items.map((item: any) => item.variant.product.handle),
} as any,
Expand Down
3 changes: 1 addition & 2 deletions components/common/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import React, { FC, useState, useEffect } from 'react'
import Link from 'next/link'
import { UserNav } from '@components/common'
import env from '@config/env'
import { BuilderComponent, builder } from '@builder.io/react'
import { useCart } from '@lib/shopify/storefront-data-hooks'
import { jsx, Themed, useThemeUI } from 'theme-ui'
Expand All @@ -22,7 +21,7 @@ const Navbar: FC = () => {
const items = cart?.lineItems || []
const anouncementContent = await builder
.get('announcement-bar', {
cachebust: env.isDev,
cacheSeconds: 120,
userAttributes: {
itemInCart: items.map((item: any) => item.variant.product.handle),
} as any,
Expand Down
4 changes: 2 additions & 2 deletions pages/[[...path]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export async function getStaticProps({
},
// Next.js will attempt to re-generate the page:
// - When a request comes in
// - At most once every 30 seconds
revalidate: 30,
// - At most once every 5 seconds
revalidate: 5,
}
}

Expand Down

0 comments on commit 620d944

Please sign in to comment.