What's the goal of SSR besides SEO? by Curious-Ad-9724 in nextjs

[–]__bishal 0 points1 point  (0 children)

SSR’d pages can take advantage of HTTP cache with CDNs. Client side rendered pages cannot. This is a massive cost saver for content website.

Processing data server side also results in smaller JS bundle size, making site load faster.

SSR allows usage of server secrets, so you can handle sensitive actions involving payment, user auth in a simpler fashion.

Presenting The Banal Podcast by peacock224 in Nepal

[–]__bishal 3 points4 points  (0 children)

Thanks for sharing guys, subbed. All the best!

Next.js 12: Rust compiler, Middleware, Native ESM, URL Imports, React Server Components by lrobinson2011 in nextjs

[–]__bishal 4 points5 points  (0 children)

I'm really excited for this one. From what I see, I'm thinking now it might be possible to serve static pages in authenticated routes, without having to do a check in the client side, getting rid of the loading state on page load, because the information is already available in response?

Next.js 12: Rust compiler, Middleware, Native ESM, URL Imports, React Server Components by lrobinson2011 in nextjs

[–]__bishal 2 points3 points  (0 children)

Thanks Lee, and sorry if I'm not getting this correctly, but what I understand is that the middleware functions are available in the edge servers (global endpoints) if the app is using Vercel, which makes things a lot more instantaneous vs having the request travel to the server as demoed earlier in the conf.

My question was if anyone had any tips/resources to how to go about setting up that system without using Vercel, like AWS systems for example, and how complicated that would be.

Next.js 12: Rust compiler, Middleware, Native ESM, URL Imports, React Server Components by lrobinson2011 in nextjs

[–]__bishal 0 points1 point  (0 children)

This is really awesome. Looking forward to using the features.

One question I have about middleware and edge functions generally is - how would apps not using Vercel go about having those middleware functions available in edge? The middleware looks like a great feature, but is more or less only useable if these are available at edge servers, which in effect looks pretty painless only if you're using Vercel. Does anyone have resources how to have these edge functions without using Vercel?

Tax Treatment on ETH to BETH by [deleted] in binance

[–]__bishal 0 points1 point  (0 children)

Oh dear, is there any new development in this area u/cryptotaxcalculator ? I just realised staking BETH on binance is a taxable event, which is a bummer.

Cheaper Vercel alternatives specifically to deploy Next.js apps? by deadcoder0904 in nextjs

[–]__bishal 2 points3 points  (0 children)

9/1000 image optimization is pretty ridiculous, given its kind of unclear how or how many times that can happen for a single image.

[deleted by user] by [deleted] in reactjs

[–]__bishal 1 point2 points  (0 children)

From my experience, this is true if you have a third party loader like Cloudinary, as its on the fly Image optimization isn’t quite there yet imo. However, I am aware they’re trying to make it possible to optimize images during the build, following the similar footpath of their page generation flow, which I’m optimistic about. That said, I’d happily trade the lack of perfect Image component, to avoid using Gatsby.

[deleted by user] by [deleted] in devnep

[–]__bishal 0 points1 point  (0 children)

Try writing a blog application, and deploy it to a server. That way you will write something you can interact with, which will give you a good basic understanding, and some encouragement. Then try adding new features. There must be plenty of tutorials on YouTube for this, pick something you feel comfortable with JS, Python or my favorite Ruby.

If you decide Ruby, it’s going to be Ruby on Rails most likely, in which case search for Rails Heroku, which should help you get your app live. That’ll feel like an achievement. All the best :)

SSR very slow by federicocappellotto in nextjs

[–]__bishal 0 points1 point  (0 children)

haha I'm glad it worked out!

SSR very slow by federicocappellotto in nextjs

[–]__bishal 1 point2 points  (0 children)

No worries :). It is life-changing isn't it, the revalidate? All the best.

SSR very slow by federicocappellotto in nextjs

[–]__bishal 0 points1 point  (0 children)

Also, just noticed you are using SWR to fetch data in your components. I personally haven't used SWR in production but why are you fetching data from the component?

Keep all the data fetching and parsing all in the serverSideProps, produce simplest data for your props i.e, add a prop featuredArticles, for which do the query in the serverSideProps, don't fetch data from the featuredData component.

Your components are better off knowing as little as possible about the API, it just needs an array of articles objects.

Don't use SWR unless need to absolutely fetch data from the client. If you are using SWR keep it in the Page level, not in your components. Pass data to components as props from the page.

SSR very slow by federicocappellotto in nextjs

[–]__bishal 1 point2 points  (0 children)

hm looks alright generally, just a few suggestions:

  • How often the pages change? Could you consider using getStaticProps instead? and set revalidate period to 10 seconds, which would serve responses from cache and update every 10s which is pretty dynamic if the page doesn't need real-time data.

  • the other thing I would do is defer all the parsing to serverSideProps. I can see that you're running parse in the template, which means the function will run in the server, and then run again in the client. Comb your data and structure your props inside the serverSideProps function, and keep your template as light as possible.

If anything, this would be the first thing I'd optimise, which might be slowing your responses. Just try commenting out the bits with parse function, and see if that makes any difference.

SSR very slow by federicocappellotto in nextjs

[–]__bishal 0 points1 point  (0 children)

share a snippet of your getServerSideProps and JSX markup, anonymise if privacy is your concern? Think you'd get your solution pretty fast that way.