Revalidate Content on FE During Entity Updates

Created on 1 August 2022, over 2 years ago
Updated 25 October 2023, over 1 year ago

Problem/Motivation

As a content editor using decoupled preview with Next.js I want to ensure that when I update content in the CMS, the related paths or tags on the front end site are invalidated so they will always display the latest content.

Proposed resolution

* If a content type is configured to use Next.js Preview and the ‘revalidate paths’ option is enabled with a valid Revalidation API Route, when content is created, updated, or deleted, a request will be made to the Next.js site to revalidate the related path.
* If a content type is configured to use Next.js Preview and the ‘revalidate tags’ option is enabled with a valid Revalidation API Route, when content is created, updated, or deleted, a request will be made to the Next.js site to revalidate the related tags.
* For this ticket, the revalidation request will happen silently in the background.
* The request to the Revalidation API route should contain the following query string parameters:
** secret - the preview site secret
** slug - the path alias (if revalidating based on path)
** tags - a list of cache tags (if revalidating based on tags)
** objectName - node--nodeType - for example node--article

More information on Next.js On-Demand Revalidation: https://nextjs.org/docs/basic-features/data-fetching/incremental-static-...

App router version: https://nextjs.org/docs/app/building-your-application/data-fetching/fetc...

Feature request
Status

Postponed

Version

1.0

Component

Code

Created by

🇺🇸United States brianperry

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States brianperry

    Updated issue summary based on recent feature enhancements in Next.js.

    Marking as postponed - Next is kind of in an awkward place during the transition between the pages router and the app router. Would be easier to implement this if we didn't have to account for multiple APIs.

    In the meantime, would be happy to re-open this if there is demand.

Production build 0.71.5 2024