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

Router route matcher caching #26119

Closed
3 of 4 tasks
szwenni opened this issue Mar 7, 2024 · 1 comment
Closed
3 of 4 tasks

Router route matcher caching #26119

szwenni opened this issue Mar 7, 2024 · 1 comment

Comments

@szwenni
Copy link

szwenni commented Mar 7, 2024

Describe the feature

I would like to know if there is a specific reason why on server side the vue router is created on every request, especially when having a huge amount of routes.

Use case is that we have a bug amount of rules, which causes a slight delay (around 200-500ms) on the server side. Looking at the performance output it clearly shows that this delay is caused by the addRoute method in the vue-router package.

I'm not sure if this can be purley implemented in nuxt, I would assume yes - I have not the whole view if the vue router object can be shared in the nuxt server instance. Most probably not. This would mean that the vue-router needs some adoptions to support some caching in between. Especially the matcherMap.

If the answer is this can not be done on nuxt side then I will create a ticket in vue-router base.

I will also try to come up with some ideas on how to cache this. As said I'm not 100% sure where the right place is. I can point to the part in the code, but I think from the above descriptions it should be easy to find it.

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

@danielroe
Copy link
Member

this is absolutely a valid issue. we're tracking it in Nuxt in #25612, but it's really an issue to be resolved in vue-router. You can see and participate in the ongoing discussion here: vuejs/router#2132.

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants