Skip to content
Dashboard

How HashiCorp developers iterate faster with Incremental Static Regeneration

Streamline development and deployment of large-scale projects with ISR.

Link to headingWhat is ISR? 

Link to headingHow HashiCorp uses ISR 

// Pre-render the top pages based on traffic data
// `fallback: blocking` will generate the page on-demand
// it if hasn't already been generated.
export async function getStaticPaths(ctx) {
return {
paths: await getTopPathsFromAnalytics(ctx),
fallback: 'blocking'
}
}
// Fetch the data for this specific page
export async function getStaticProps(ctx) {
return {
props: await getDocumentationContent(ctx),
revalidate: 360 // 1 hour
  }
}

pages/api/revalidate.js
export default async function revalidate(request, response) {
const { secret, path } = request.query
// Check for secret to confirm this is a valid request
if (secret !== process.env.REVALIDATE_SECRET) {
return response.send(401)
  }
if (await isValidPage(path)) {
  await response.unstable_revalidate(path)
return response.status(200).json({ revalidated: true })
}
 
return response.send(400)
}

A lot of teams struggle with trying to implement their own version of ISR at scale. In an enterprise organization, entire teams can be dedicated to making it work. But with Vercel, ISR works out of the box.
Bryce Kalow Senior Web Engineer at HashiCorp

Link to headingTry on-demand ISR