nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.03k stars 618 forks source link

Low performance with Nuxt 3 + Content 2 #1716

Open giticon opened 1 year ago

giticon commented 1 year ago

Environment

Reproduction

website is private. Code is absolutely minimal

Describe the bug

I've ported a website from Nuxt 2 + Content 1 to Nuxt 3 + Content 2.

I have a structure where there are 30 pages under /pages and 10 under /content/blog created in Markdown.

These 10 pages are really long documents (50/70K characters) with about 20 components inside for each blog page.

If I use

content: { documentDriven: true }

the loading is quite fast (500ms).

With documentDriven:false the blog index takes about 5 seconds just to give me the list of titles+_path!

With Nuxt 2 + Content 1 the loading, in dev mode, was practically immediate. Now is VERY slow.

I also tried adding more pages in the blog and the time to get the list of pages comes to 10 sec! Even to open individual posts takes several seconds.

With

const { data } = await useAsyncData('articles', () => queryContent('/blog').only(['title','_path']).find())

it almost seems like it actually goes and reads all the documents in full before providing the titles. I also tried with without([body]) + other combination. Nothing: in dev mode it is always very slow to load both the list of pages in the blog index and the individual pages.

What can I do/try?

Additional context

No response

Logs

No response

Barbapapazes commented 1 year ago

Same issue tracked in #1651