Architecture for heavy load webiste
Unanswered
Schneider’s Smooth-fronted Caima… posted this in #help-forum
Schneider’s Smooth-fronted CaimanOP
Hello,
i have a website with lots of traffic (good for me)
i’m exploring the opportunity to move to nextjs framework
it is basically an e-commerce website
on the home page, i render product carousels
most of them can be rendered statically
some of them are user recommandations so should be dynamic based on user data
in my current stack, i render 2 versions of the page base on a session cookie
- one with static carousels and default recommandations for unlogged user and for google seo purposes
- second with static carousels and skeleton in place of user recommendations, that will have their final render made client side
those 2 versions are put in a CDN
with this i can handle a lot of traffic, with low cost and no worries about the load i can adress
If i switch to nextjs, from all the research i made, it seems i have the following choices:
- do PPR and host on vercel but my costs will sky rocket
- do dynamic rendering and even streaming without CDN for the html but my cost will also increase and i’ll have to worry about handling the load as each request will get to my servers
- do SSG and ISR but i wont be able to render 2 versions based on session cookie, so i would either render skeleton for reco even for unlogged / google OR render the default recommandations and switch it client side, but then from my pov it is a negative impact on user xp
- another way i explored was to do dynamic rendering, ppr and streaming but still cache the response in 2 versions in my CDN at the CDN level as nextjs would add the max-age=0 header. the issue i see here is that the streamed response that will be cached by the CDN will contain javascript to populate the originaly streamed content and put it at the correct place in the dom, so not great for SEO and not great for user compared to a fully final HTMl in my current unlogged user response
any thoughts will be greatly appreciated 🙏
i have a website with lots of traffic (good for me)
i’m exploring the opportunity to move to nextjs framework
it is basically an e-commerce website
on the home page, i render product carousels
most of them can be rendered statically
some of them are user recommandations so should be dynamic based on user data
in my current stack, i render 2 versions of the page base on a session cookie
- one with static carousels and default recommandations for unlogged user and for google seo purposes
- second with static carousels and skeleton in place of user recommendations, that will have their final render made client side
those 2 versions are put in a CDN
with this i can handle a lot of traffic, with low cost and no worries about the load i can adress
If i switch to nextjs, from all the research i made, it seems i have the following choices:
- do PPR and host on vercel but my costs will sky rocket
- do dynamic rendering and even streaming without CDN for the html but my cost will also increase and i’ll have to worry about handling the load as each request will get to my servers
- do SSG and ISR but i wont be able to render 2 versions based on session cookie, so i would either render skeleton for reco even for unlogged / google OR render the default recommandations and switch it client side, but then from my pov it is a negative impact on user xp
- another way i explored was to do dynamic rendering, ppr and streaming but still cache the response in 2 versions in my CDN at the CDN level as nextjs would add the max-age=0 header. the issue i see here is that the streamed response that will be cached by the CDN will contain javascript to populate the originaly streamed content and put it at the correct place in the dom, so not great for SEO and not great for user compared to a fully final HTMl in my current unlogged user response
any thoughts will be greatly appreciated 🙏