Skip to content

Conversation

@farnabaz
Copy link
Member

@farnabaz farnabaz commented Jan 26, 2024

๐Ÿ”— Linked issue

resolves #2449

โ“ Type of change

  • ๐Ÿ“– Documentation (updates to the documentation or readme)
  • ๐Ÿž Bug fix (a non-breaking change that fixes an issue)
  • ๐Ÿ‘Œ Enhancement (improving an existing functionality like performance)
  • โœจ New feature (a non-breaking change that adds functionality)
  • โš ๏ธ Breaking change (fix or feature that would cause existing functionality to change)

๐Ÿ“š Description

The bottleneck in the pre-rendering phase is getting contents list from file system. By caching the list in the pre-render process, the generation time will drop significantly.

This change reduce the generation time in Content docs from 15s to 5s on my machine

๐Ÿ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

export const cacheParsedStorage: Storage = prefixStorage(useStorage(), 'cache:content:parsed')

const isProduction = process.env.NODE_ENV === 'production'
const isPrerendering = process.argv?.includes('generate')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use import.meta.prerender

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 26, 2024

Deploying with ย Cloudflare Pages ย Cloudflare Pages

Latest commit: 732edc1
Status:ย โœ…ย  Deploy successful!
Preview URL: https://77e5d7bd.nuxt-content-1il.pages.dev
Branch Preview URL: https://perf-cache-contents-list.nuxt-content-1il.pages.dev

View logs

@manlm
Copy link

manlm commented Feb 1, 2024

may i ask when will this be released

Copy link
Member

atinux commented Feb 2, 2024

@manlm you can use the edge channel to use it today: https://content.nuxt.com/get-started/edge-channel

Release should be next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prerender takes 10 minutes per page!!!

4 participants