
Learn Next.js: Adding Authentication
Add authentication to protect your dashboard routes using NextAuth.js, Server Actions, and Middleware.
페이지 방식


On-Demand ISR
Instantly update content without redeploying.
Incremental Static Regeneration (ISR) – Nextjs 한글 문서
Learn how to create or update static pages at runtime with Incremental Static Regeneration.

@tailwindcss/typography - Tailwind CSS
A first-party plugin for providing beautiful typographic defaults.
tailwindcss를 쓰면 기본적인 html의 스타일링이 모두 제거된다.
className
으로 직접 스타일링을 해주지 않으면 일반 텍스트로 보이게 된다.외부에서 가져온
html
content나 markdown
content를 렌더링 해야하는 등의 상황에서 문제가 되는데, @tailwindcss/typography plugin의 prose
클래스를 통해 기본 바닐라 html의 스타일링이 적용되도록 할 수 있다.백엔드 역할 정의
Routing: API Routes
Next.js supports API Routes, which allow you to build your API without leaving your Next.js app. Learn how it works here.
Data Fetching: Data Fetching and Caching
Learn best practices for fetching data on the server or client in Next.js.
fetch로 호출하는 것은 캐싱이 자동 적용됨.
하지만 db를 읽거나 파일을 읽는 등 fetch 외에 다른 방식으로 읽는 경우는 별도로 캐싱 작업 필요.
cache로 감싸서 함수를 정의해주면 됨.
한번의 렌더링 사이클 내에서 한 api를 여러번 호출할 경우, 호출하는 인자가 동일하다면 캐싱된 것을 재사용함.
즉 렌더링 되는 페이지가 다르거나 다시 렌더링 하는 . 등 렌더링 사이클이 다시 동작하는 경우까지 캐싱되는 것은 아님.
페이지 3개가 있고 두 개의 페이지에선 동일한 api를 2번씩 호출하고, 나머지 한 페이지에선 1번만 호출한다면 총 5번을 호출하게 되는데,
캐싱을 입히면 페이지당 1번만 호출하므로 3번으로 줄어듦.