Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

자체 이미지 최적화 작업 #654

Closed
hanyugeon opened this issue Jul 1, 2024 · 0 comments · Fixed by #656
Closed

자체 이미지 최적화 작업 #654

hanyugeon opened this issue Jul 1, 2024 · 0 comments · Fixed by #656
Assignees
Labels
✨ feature New feature or request 🐥 프론트 필수! 🔥 v.1.0 New feature for releasing v.1.0

Comments

@hanyugeon
Copy link
Member

hanyugeon commented Jul 1, 2024

목적

Next/Image컴포넌트를 통해 vercel이 제공하는 이미지 최적화는
최근 30일 기준 최대 1000개까지 이미지 캐싱이 가능해요.
(1000개가 넘어가면 이미지가 패칭되지 않아요.)

해당 이슈를 통해서 도서 검색기능과 같이
이미지 요소를 많이 불러오는곳에 활용될
자체 Image 컴포넌트를 제작합니다.

Sharp + API routes 조합을 활용합니다..!

참고

@hanyugeon hanyugeon added 🐥 프론트 필수! ✨ feature New feature or request 🔥 v.1.0 New feature for releasing v.1.0 labels Jul 1, 2024
@hanyugeon hanyugeon self-assigned this Jul 1, 2024
hanyugeon added a commit that referenced this issue Jul 10, 2024
* setting: Sharp 설치

* feat: sharp를 활용한 외부 이미지 최적화 api routes 작성

* feat: SharpImage 컴포넌트 src, width, height, alt props 구현

* feat: 로컬 이미지 최적화 기능 추가

* fix: 이미지 요청이 중복해서 2, 3번 가던 버그 수정

* feat: 이미지 리사이징 기능 추가

* feat: img태그를 unoptimized 옵션의 Next/Image로 대체

* feat: gif 지원 기능 추가

* fix: 절대경로 인식 못하던 버그 수정

* refactor: SharpImage를 Image로 변경

* feat: 각 페이지에 새로운 Image 컴포넌트 적용

* chore: 필요없는 콘솔 로그 제거

* fix: api routes를 app 라우터 컨벤션으로 수정

* fix: BookCover를 제외한 곳에서는 임시적으로 Next/Image 활용

* fix: Vercel build 에러 해결 (Sharp를 0.32.6으로 다운 그레이드)

* fix: api 컨벤션 수정

* chore: common/Image.tsx 컴포넌트의 NextImage import문 수정

* fix: common/Image 타입 선언 수정
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature New feature or request 🐥 프론트 필수! 🔥 v.1.0 New feature for releasing v.1.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant