Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for App Router Invalidation by Tag in Drupal Module #812

Open
backlineint opened this issue Oct 22, 2024 · 1 comment
Open
Assignees
Labels
enhancement New feature or request triage A new issue that needs triage

Comments

@backlineint
Copy link
Collaborator

backlineint commented Oct 22, 2024

Package

next (Drupal module)

Describe the feature request

This is a follow up to the discussion in #763 and #797

Similar to the module's path based revalidation, we should update the module to call our revalidation endpoint for the app router's revalidation by tag.

Describe the solution you'd like

  • For a next.js entity type (the config entity) we'd need to add a new plugin option under on-demand revalidation to select if we should invalidate by tag.
  • modules/next/modules/next_extras/src/NextCacheInvalidator.php will need new getTagsToInvalidate and invalidateTags methods.
    ** The invalidateTags method will make an API call to the revalidation endpoint, and pass a comma separated list of all cache tags using the tags parameter. (Updates to FE API route are outlined here: feat(next-drupal): next revalidate options #784)
  • invalidateEntity will need to add conditional logic to check for the invalidation type and adjust accordingly.
  • getRevalidateUrlforPath needs to be made more generic - currently it always adds the path query string parameter.

Describe alternatives you've considered

A page router based approach was implemented here: #797

@backlineint
Copy link
Collaborator Author

@minnur we merged the updates to API routes that this will depend on. As outlined here, the tags param is comma separated. I tested that it will work if either encoded or not encoded. As you dig in, curious if you think comma separated makes the most sense here. Would be a pretty easier change if another delimiter makes more sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage A new issue that needs triage
Projects
None yet
Development

No branches or pull requests

2 participants