Skip to content
Discussion options

You must be logged in to vote

Are you deploying with Vercel? If so, I'd recommend using getStaticPaths / getStaticProps in combination with Incremental Static Regeneration. Here's how this would work:

  1. You'd have a product page like /pages/products/[name].js. getStaticPaths would fetch all the product IDs or names to generate all of the routes. getStaticProps would fetch the single product snapshot from Firestore.
  2. Using fallback: true and unstable_revalidate, you can periodically regenerate the static pages, ensuring there's zero downtime for your products (very important for e-commerce).

This will be the best approach for SEO and performance.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@adapan-bak
Comment options

Answer selected by adapan-bak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants