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

generate sitemap automatically without build again for dynamic routes. #186

Closed
farshidrezaei opened this issue Mar 1, 2021 · 2 comments
Closed
Labels

Comments

@farshidrezaei
Copy link

generate sitemap automatically without build again for dynamic routes.

i returned a promise that in that, i get dynamic routes by axios. but if i change any route in backend, sitemap not update until i rebuild nuxt app.

how i can generate sitemap on runtime?

@tol64
Copy link

tol64 commented Mar 1, 2021

Try this one: #79 (comment)

But there is also the problem of dynamic formation of the sitemapindex file. I described it in more detail at the link above.

@NicoPennec
Copy link
Member

NicoPennec commented Mar 3, 2021

@farshidrezaei By default the cacheTime option is define at 15min. Try to reduce this value as per your convenience.

Eg. set the minimal value of 1 ms as below:

sitemap: {
  cacheTime: 1,
  // example of dummy dynamic route to check the freshness
  routes: () => {
    return [
      { url: new Date().toISOString() }
    ]
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants