1. 문제

Next.js를 사용하여 페이지를 개발하는 과정에서 아래와 같은 경고 메시지가 발생함.

warn-once.js:16 Image with src "/_next/static/media/basic.7bd48856.png" was detected as the Largest Contentful Paint (LCP).
Please add the "priority" property if this image is above the fold.

이 경고는 페이지에서 가장 큰 이미지(Largest Contentful Paint, LCP)가 감지되었으며, 최적화를 위해 priority 속성을 추가하라는 내용을 포함하고 있음.

2. 원인 분석

3. 해결 방법

priority 속성 추가

가장 먼저 보이는 주요 이미지에 priority 속성을 추가하면, 브라우저가 이를 우선적으로 로드할 수 있음.

수정 전 코드:

<Image
  src="/_next/static/media/basic.7bd48856.png"
  alt="Basic Image"
  width={500}
  height={300}
/>

수정 후 코드:

<Image
  src="/_next/static/media/basic.7bd48856.png"
  alt="Basic Image"
  width={500}
  height={300}
  priority // ✅ LCP 이미지 최적화 적용
/>

📌 priority 속성의 동작 방식

4. 추가 검토 사항