Calling a Separate Backend — Concept Check
Questions on Calling a Separate Backend. When the real API is FastAPI or Spring Boot, Next becomes a client of it — and the choice of whether the browser or the Next server makes that call changes auth, CORS and latency.
Questions in this quiz
7 questions on Calling a Separate Backend — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A Next.js app uses server-side rendering for initial page load. Which topology is being used?
- ABrowser-to-Next-to-API
- BBrowser-to-API
- CBrowser-to-Proxy-to-API
- DAPI-to-Next-to-Browser
2.In a Next.js app, why might you choose to have the browser call the API directly?
- ATo ensure the token never reaches the browser
- BTo avoid CORS issues
- CTo reduce latency by eliminating an extra hop
- DTo improve SEO with server-rendered HTML
3.What is a potential downside of having the Next server call the backend?
- AIncreased CORS issues
- BExtra network hop
- CReduced SEO capabilities
- DToken exposure to the browser
4.A developer notices that a server-rendered page is loading without user-specific data. What might be the issue?
- AThe page is cached
- BCORS is blocking the request
- CThe cookie is not forwarded
- DThe API URL is incorrect
5.Why is it important to set a timeout for server-to-backend calls in a Next.js app?
- ATo improve SEO
- BTo prevent CORS issues
- CTo avoid holding serverless functions open too long
- DTo ensure cookies are forwarded
6.What is the benefit of using a proxy through Next.js for API calls?
- AIncreases CORS issues
- BImproves SEO
- CReduces network hops
- DCookies become first-party
7.A Next.js app is experiencing slow initial page loads after a period of inactivity. What could be the cause?
- AExcessive caching
- BCORS issues
- CToken expiration
- DBackend cold start