This module allows you to define custom cache tags for any Drupal entity type to precisely control how your Next.js frontend caches and revalidates content. When content changes, it automatically triggers only the necessary revalidations for your Next.js application, preventing full site rebuilds.
Next Custom Tags provides fine-grained control over Next.js tag-based caching by allowing developers to define custom cache tag plugins for any Drupal entity type.
Implement complex, targeted caching strategies without full site rebuilds. When content changes, the module automatically extracts the relevant tags and revalidates only the affected pages in your Next.js frontend.
Key Features
- Entity-Agnostic Plugin System: Create plugins for Nodes, Blocks, Menus, Webforms, custom entities, or any other entity type.
- Automatic Revalidation: When entities are created, updated, or deleted, enabled plugins extract tags and trigger a revalidation request to your Next.js frontend.
- Manual Control: A dedicated interface to manually revalidate specific tags on demand.
- Custom Tag Definitions: Define tags that live outside of entities (e.g., global settings tags) for manual management.
- Developer Visibility: The settings form shows example tags generated by each plugin, so you can verify exactly what is sent to Next.js.
- Configurable Revalidate URL: Uses the revalidate URL from your Next.js site configuration, with a sensible fallback.
How It Works
- Configure: Enable plugins for the entity types you want to track.
- Edit Content: When an editor saves an entity, the module invokes the relevant plugin.
- Extract: The plugin generates cache tags based on any logic you define — not just entity IDs. Create arbitrary tags matching your frontend components (e.g.,
collection:featured,menu:main-footer, ortaxonomy:term:123). - Revalidate: The module sends a revalidation request to your Next.js site for those specific tags, keeping your frontend up-to-date without rebuilding the entire site.
Configuration & Usage
The module provides three administrative interfaces:
-
Plugin Configuration:
/admin/config/services/next-custom-tags/plugin-settings
Enable or disable plugins per Next.js site, view example tags, and configure manual revalidation options. -
Manual Revalidation:
/admin/config/services/next-custom-tags/revalidate
Manually trigger revalidation for specific tags when needed. -
Custom Tag Definitions:
/admin/config/services/next-custom-tags/custom-tags
Register tags that are not automatically extracted from entities but may need manual revalidation.
Included Submodules
- Next Custom Tags - Block (
next_custom_tags_block): Cache tag extraction for Block Content entities. - Next Custom Tags - Menu (
next_custom_tags_menu): Cache tag extraction for Menu Link Content entities, ensuring navigation updates immediately when menu links change. - Next Custom Tags - Webform (
next_custom_tags_webform): Cache tag extraction for Webform entities.
Requirements
- Drupal: Compatible with Drupal 10 and 11.
- Dependencies: Next.js module
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
Release Timeline
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.0.0-beta4 | Pre-release | 10–11 | New submodules for Block, Menu & Webform cache tags; configurable revalidate URL; optimized & deduplicated tag revalidation; plugins disabled by default. | Mar 2, 2026 | |
| 1.0.0-beta3 | Pre-release | 10–11 | Improved custom cache tag management and plugin settings visibility. | Jan 24, 2026 | |
| 1.0.0-beta2 | Pre-release | 10–11 | Removed config and schema | Jan 23, 2026 | |
| 1.0.0-beta1 | Pre-release | 10–11 | initial beta release | Jan 23, 2026 | |
| 1.x-dev | Dev | 10–11 | dev release | Jan 23, 2026 |