next-drupal
next-drupal copied to clipboard
Add invalidate path hook
This adds a hook after successful on-demand revalidation. This is useful if you then need to clear a cache such as cloudfront.
Someone is attempting to deploy a commit to the Chapter Three Team on Vercel.
A member of the Team first needs to authorize it.
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/chapter-three/next-drupal/FcKTFkRhg2Xt6uvxDEJHS1J6zXvA
✅ Preview: Canceled
I like this. I can definitely see this being useful.
However, since the revalidation API is still experimental in Next.js, I'd like to let this sit for a while and decide on how best to approach this.
Do we want hooks or events? Should we use a plugin system?
<?php
class ArticleRevalidation extends RevalidationBase {
function preValidation();
function postValidation();
}
What do you think?
I think Events is better since we are on Drupal 9.x at the moment.
Could this be revisited now that revalidation API is stable?
@dottodot Definitely. Thanks for the ping. I'll start looking into this.
@shadcn Has there been any progress on this or decision on a route to take. Can always submit a new pr using the preferred approach if not.
@dottodot Yes. I've implemented a plugin + event subscribers for handling revalidation. WIP here: https://github.com/chapter-three/next-drupal/pull/301
I'll push to a dev release and we can test it.