Serverside Rendering

I'm trying to only use Clientside Rendering, yet something is using SSR on my Cloudflare Pages. How can I find out what?
No description
11 Replies
! Julius Cole
! Julius Cole11mo ago
Still having the issue and can't really find what is using it. We have nodejs compat in compatibility flags but that's cause we use Next.JS
Chaika
Chaika11mo ago
iirc next-on-pages uses its own custom routing function, and some other special logic, so even static pages count as function requests, the only thing that is excluded is requests to assets in /_next/static/ folder
James
James11mo ago
Indeed. If you don't want to have any form of server functionality, you could use a static export of your Next.js app instead. It's worth noting that static exports have some limitations that you can read about in the Next.js docs. https://nextjs.org/docs/app/building-your-application/deploying/static-exports https://developers.cloudflare.com/pages/framework-guides/deploy-a-nextjs-site/#use-a-static-export
! Julius Cole
! Julius Cole11mo ago
Do you think even with high traffic it will use much bundled requests then? Also that's pretty dumb, if I want to render completely on client, I should be able to.
James
James11mo ago
If you want purely client side, you should use a static export. If you don't want purely client side and want server functionality or some of the other features that come with server functionality, like non-SSG dynamic routes, you have no choice. Having our own routing isn't dumb, it's the only way to make it possible to deploy a nextjs app with the best functionality and compatibility we can. High traffic using more requests depends on how you write your site. By default, nextjs prefetches link elements on a page - you can disable that behaviour with the link component, thereby reducing extra requests. Static assets in _next/static don't involve the worker. You can set extra assets that shouldn't invoke the worker too in the generated routes file if you want.
! Julius Cole
! Julius Cole11mo ago
I'll need dynamic on a lot of components so no.
simpson
simpson11mo ago
Wait so static pages get counted against functions usage?
James
James11mo ago
If you use next-on-pages, requests to any route will need to go through the generated worker's routing system to be matched to the correct page in accordance with the rules and phases generated by Vercel. If you want a static site without any server functionality/function invocations, a static export would be better suited.
simpson
simpson11mo ago
That makes sense but it does stink a little, you still get the performance of static but it drives up function consumption
Vector
Vector10mo ago
What about other javascript frameworks? Like just using plain React, or Angular Or Vue
Chaika
Chaika10mo ago
if they're static exports(just html/css/jss), then they wouldn't count as function requests, just static asset requests, which are free and unlimited on Pages. Please make your own post rather then reusing an existing one though. If you have a question about a specific framework using function requests, please include all that info in your own post
Want results from more Discord servers?
Add your server
More Posts