강의

멘토링

커뮤니티

Inflearn Community Q&A

dlfwnd55320860's profile image
dlfwnd55320860

asked

Next.js with Spring Boot

Pagination processing

todoPagingCP.tsx에서

Written on

·

51

0

todoPagingCP.tsx에서 Link로 페이지 동적으로 만들었는데 페이지 클릭때마다

 

 const res = await fetch(
        `http://localhost:8080/api/todos/list?page=${page}`
    );

todo/list/page에 있는 이코드가 실행이 되는건가요?

javascriptreactspring-bootjpanext.js

Answer 1

1

zk202308a5410님의 프로필 이미지
zk202308a5410
Instructor

네 맞습니다.

만일 1분마다 목록을 갱신하고 싶다면 아래 처럼 설정을 변경할 수 있습니다.

const res = await fetch('http://localhost:8080/api/todos/list?page=${page}', {

next: { revalidate: 60 }, // 60초 동안 캐싱

});

강의에서는 자주 변하지 않는 경우와 변경이 잦은 경우에 따라 설정하는 방법을 모두 설명합니다.

dlfwnd55320860's profile image
dlfwnd55320860

asked

Ask a question