Skip to content

[ Refactor ] axios → fetch 도입해서 조회 시 캐싱하기 #138

Description

@sinji2102

♻️ Issue

axios보다 fetch가 서버 컴포넌트와 호환성이 뛰어나며, NextJS에서도 같은 이유로 fetch를 사용하는 것을 권장하고 있으므로 axios에서 fetch를 도입하여 API를 캐싱하고자 합니다.

관련 공식 문서 : https://nextjs.org/docs/app/api-reference/functions/fetch

🔢 리팩토링하는 이슈를 기입해주세요.

[ Feat ] 리액트 쿼리 및 커스텀 axios 세팅 #41

📣 리팩토링 목적

  1. 현재 캐싱이 진행되고 있지 않으므로 자동 캐싱을 위해 fetch를 도입하고자 합니다.
  2. NextJS에서 axios보다 fetch를 권장하고 있으므로, 기존의 axios 코드에서 fetch로 변경하고자 합니다.

📝 To-do

  • customFetch util 생성
  • axios -> fetch 변경
  • 메인 / 어드민 force-cache 도입
  • 로그인 필요 기능 Tanstack-Query 사용해서 캐싱

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions