-
Notifications
You must be signed in to change notification settings - Fork 187
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
New nodes do not revalidate the new path alias #843
Comments
@pookmish I'm not sure if this is a bug, but do you need to revalidate the URL alias when creating new content? Before the content is created, accessing the URL results in a 404 page. Once the content is created, it should appear at the URL without requiring revalidation. |
When using ISR (or even some type of fetch/data cacheing), the page would cache as 404. It requires some type of revalidation to allow the page to fetch data. How would it just "appear" without being triggered for revalidating? Yes if the path has never been access, no cache would be established for that path and it would build at request time. My current work around on the NextJS side is to detect the |
You're right, I was able to confirm that the 404 page is cached in the Pages Router Starter. It looks like changing the following code to $event->getEntity()->toUrl()->toString() would allow the URL alias generated by Pathauto to be revalidated when a new node is created. That said, I’m not sure if this is the best approach. |
@ksk1kd I tested out a version of your idea. If I change the EntityActionEvent to use the URL object instead of a string, it seems to invalidate the path alias as expected. I believe this gives the system time to register the path alias before the revalidation plugin is executed. I'll put together a PR here: #844 Let me know your thoughts. |
Package containing the bug
I’m not sure
Describe the bug
When pathauto is configured and a node is created, the revalidator plugin only attempts to invalidate the
/node/##
path. It does not revalidate the new path alias generated.Expected behavior
Revalidation should be executed with the new path alias.
Steps to reproduce:
[node:title]
/node/#
path, but not the new path alias pattern.Additional context
The text was updated successfully, but these errors were encountered: