Skip to content

Add NextFetchRequestConfig, such as next.revalidate, to fetch requests #761

Open
@davidwhthomas

Description

@davidwhthomas

Package

next-drupal (NPM package)

Ask the question

Next.JS App Router supports useful custom fetch request options related to caching such as

  • fetch("https://...", { next: { revalidate: false | 0 | number } })
  • fetch("https://...", { next: { tags: ['node:1', 'tag:2'] } })
  • fetch("https://...", { cache: 'force-cache' | 'no-store' })

However it's not clear how or if we can pass those with the fetch requests from next-drupal requests.

It would be great if we could pass those per request, e.g for JSON:API requests but appears we perhaps can't pass those options at the moment.

I'm currently using "next-drupal": "^2.0.0-beta.0"

Do you have any recommendations on this?

With thanks for the excellent Next.JS and Drupal integration module.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions