N
Nuxt6mo ago
Rocs

Best way to cache a pre-rendered SSG project?

Hello! Currently I am working in a project that aims to prerender using data from a Database around 25000 pages I already got everything working: - SEO - prerender - SSG pipeline build - Deploying using Github actions + Aws S3 + Cloudfront - i18n My issue right now is that when I run the build both in local or in github actions I get memory issues, long build time (1 hour +) and it won't be scalable if I add mkre. My idea right now is to cache the prerendered pages in the project so I can just do the generate and update the specific pages when needed. But can't figure out any documentation or where to start. If someone has some suggestions, ideas or a better way to tackle the problem, would be awesome! PS: I read about ISR with vercel, but I don't want to change my current infrastructure
9 Replies
manniL
manniL6mo ago
25k pages prerendered sound a lot you could use ISR with a running server to avoid memory issues and long buil times
manniL
manniL6mo ago
Alexander Lichter
YouTube
Nuxt 3.10 - Speed up your build time with sharedPrerenderData
⏰ Nuxt 3.10 is out for a few days and brought quite some features! One of them is especially helpful for prerendered, often content-heavy sites. But what is it and how will it reduce our build time? Together we will have a look at the new experimental sharedPrerenderData features, figure out what it is and how it works! Key points: 🆕 Showcasing...
Dovendyret
Dovendyret6mo ago
I've had the same issue. We have an ecommerce shop with 12 different languages and a lot of SEO content for each language. I've tried pre-rendering all my SEO pages which is around 40k pages and then my server also runs into memory issues. Pre-prendering this content would be preferable but for now we settled for SWR with redis
Rocs
RocsOP6mo ago
Thanks @manniL used that already build time improved, but still issues in build time For now I limited to 2500 pages, and it finished, but wanna go for 10x @Dovendyret will explore SWR too thanks _ Really aiming to keep the prerendering... Wanted to find a way to cache the folder: .output/public so it doesn't rebuild unless a certain trigger is met But haven't found a way yet Another thought is to run multiple builds, and upload each build by parts, for example each github action builds pages 1-1000 and I run 25 async jobs...
manniL
manniL6mo ago
Why would you want to prerender that so badly and not go with ISR?
Rocs
RocsOP6mo ago
Trying to optimize costs for now, since it's a hobby project mainly for yugioh cards 🤔 but maybe switching cloud provider could be best
manniL
manniL6mo ago
Cloudflare workers should be the easiest for that cost wise
Rocs
RocsOP6mo ago
Will look into it, surprised on that 100k requests daily for free!! thank you @manniL / TheAlexLichter!!
manniL
manniL6mo ago
No problem!
Want results from more Discord servers?
Add your server