NuxtN
Nuxt3mo ago
4 replies
.fondazione

Nuxt Content page very slow even with .select() or queryCollectionNavigation()

Hey,

I’m using Nuxt Content and have around 26 large markdown files (about 4 MB each).
On my homepage, I only need a few fields like id, word, path.

I tried using this:
const { data: articles } = await useAsyncData('articles', () =>
  queryCollection('articles').select('id', 'word', 'path').all()
)

and also
const articles = await queryCollectionNavigation('articles', ['id', 'word', 'path'])


But my page is still very slow, and I see a big .sql.txt file being loaded on the first request.

Does anyone know how to make the page faster? I want to build a static page, so ideally no api end routes.
I just want to list my articles without loading all the big markdown files.

Thanks for any advice 🙏
Was this page helpful?