Closed rahulkumarsingh73690 closed 5 months ago
Is there any way to enable caching to prevent more CPU usage?
Do you have the deployed website or some infos to share to help debug?
If the page is pre-rendered, it should be served from the CDN directly so not calling the Nuxt server (worker).
I don't have stats but pre-rendered still counts as a worker request and CPU usage. I have a traffic site where I am facing this issue.
I will try get data from small project
And one more thing
'/blog/**': { prerender: true },
Does nothing only
'/blog/': { prerender: true },
Works
Please check full discussion on discord with @manniL - https://discord.com/channels/473401852243869706/1244656036002926645
So, Nitro cannot follow the link as we did not configure the crawlLinks option but we should not in the hybrid mode
One solution is to use the prerenderRoutes()
[https://nuxt.com/docs/api/utils/prerender-routes) util in your blog.vue
page to list all the other blog post pages.
Example:
<script setup>
const { data: posts } = await useFetch('/api/posts')
prerenderRoutes(posts.value.map(post => `/blog/${post.slug}`))
</script>
Even after enabling routeRules prerender in some routes nuxt, some routes still consume the same amount of CPU.