Next.js Discord

Discord Forum

Advice for deploying so that logged out pages can load with as low latency as possible

Unanswered
Spectacled bear posted this in #help-forum
Open in Discord
Spectacled bearOP
I have a website deployed on AWS that uses the nextjs framework. This is my first project using next, and I believe I am using it improperly, so I am looking for some advice on correctly using this framework.

My website currently has "logged out" and "logged in" pages. The logged in pages contain a lot of specific user data and is highly interactive (basically a SPA), but the logged out pages have nothing specific to a user and could theoretically be statically generated. All logged out pages can be viewed while logged in (and therefore it should be one website, not two different subdomains, so that going back and forth between logged out and logged in pages shouldn't need to refetch data).

Currently, the entire website is using CSR. I'm using a custom server.ts and have the frontend server deployed to AWS (and proxies all requests to the backend server through itself).

What I'd like to change about this setup:
1. I'd like the logged out pages to load as fast as possible. This likely means either setting up a CDN or using SSR for these pages (or both). Would love a recommendation.
2. If I can get reasonable performance improvements by making some changes to the logged out pages, I'm interested in hearing thoughts, but this is not as important.

1 Reply

Spectacled bearOP
bump, thanks!