You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#784 introduced revalidate options for the fetch methods used by the Next Drupal client, including tags. But currently the page templates in our starters don't use them when making fetch requests.
Describe the solution you'd like
A little bit on the fence here, but it seems like the revalidation option might be the best starting point, with tags being an option that is easy to enable.
In app/slug/page.tsx:
** Create a new const tag based on the data returned from translatePath. The value should be of the type entity.type:entity.id
** In the options for getResource, pass a next object with:
*** Revalidate set to some default value (3600?)
*** Tags set to the value of the tag const. This should be commented out by default.
In app/page.tsx:
** In the options for getResourceCollection, pass a next object with:
*** Revalidate set to some default value (3600?)
Note: it isn't clear to me how to efficiently use tags to invalidate this articles list. We won't know the individual node ids until we get the response back, and the only grouped tag I see from jsonapi is 'node_list' which seems to broad. As a result, invalidation only seems like the best place to start.
Describe alternatives you've considered
Defaulting to tags instead of revalidate/paths. Could make this change if we hear positive feedback related to the new tag based revalidation features.
The text was updated successfully, but these errors were encountered:
Package
basic-starter
Describe the feature request
#784 introduced revalidate options for the fetch methods used by the Next Drupal client, including tags. But currently the page templates in our starters don't use them when making fetch requests.
Describe the solution you'd like
A little bit on the fence here, but it seems like the revalidation option might be the best starting point, with tags being an option that is easy to enable.
In app/slug/page.tsx:
** Create a new const
tag
based on the data returned from translatePath. The value should be of the typeentity.type:entity.id
** In the options for getResource, pass a next object with:
*** Revalidate set to some default value (3600?)
*** Tags set to the value of the
tag
const. This should be commented out by default.In app/page.tsx:
** In the options for getResourceCollection, pass a next object with:
*** Revalidate set to some default value (3600?)
Note: it isn't clear to me how to efficiently use tags to invalidate this articles list. We won't know the individual node ids until we get the response back, and the only grouped tag I see from jsonapi is 'node_list' which seems to broad. As a result, invalidation only seems like the best place to start.
Describe alternatives you've considered
Defaulting to tags instead of revalidate/paths. Could make this change if we hear positive feedback related to the new tag based revalidation features.
The text was updated successfully, but these errors were encountered: