Next.js revalidate module
No security coverage
This module works only for an application that has next.js as front-end framework. The goal is to inform next server to invalidate the cache and revalidate the page.
How-to
- composer require drupal/nextjs_revalidate
- drush en nextjs_revalidate -y
- Implement the hook_nextjs_revalidate_entity($entity) that makes the logic when an entity has been saved ()
if (
!$entity instanceof \Drupal\node\NodeInterface &&
!$entity instanceof \Drupal\menu_link_content\MenuLinkContentInterface
) {
return;
}
\Drupal::messenger()->addStatus(
t(
'Your change will be visible on the site in a few seconds.',
[],
['context' => 'nextjs_revalidate']
)
);
$queue = \Drupal::service('queue')->get('nextjs_revalidate_queue');
$queue->createItem($entity);
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Release date | |
|---|---|---|---|---|
| 1.0.0-beta1 | Pre-release | Aug 16, 2023 |