Next.js Discord

Discord Forum

ISR - getStaticProps make API requests per page visit

Answered
Vadym posted this in #help-forum
Open in Discord
Hello folks!
Does the page with ISR make API requests (from getStaticProps) per each page visit?

I try implementing On Demand ISR for my main page and see that content changes dynamically from API.

Should It work in this way? I thought that it should be cached too and fetch new data from API only when revalidation time was finished and a new user opened the page (now it works not the same)Does the page with ISR make API requests (from getStaticProps) per each page visit?
Answered by joulev
in dev mode, getStaticProps runs [on every request](https://nextjs.org/docs/pages/building-your-application/data-fetching/get-static-props#runs-on-every-request-in-development). in prod mode it only runs at build time.
View full answer

4 Replies

Additionally to my question.
Currently, the page fetches new data from the API even If I do not trigger to revalidate the page from my API at all.
Does ISR works properly in production mode?

when I start my local by
next dev

I see that page makes request to get data from API per each page visit.

but when I started my local by NODE_ENV=production next dev, everything worked properly
Answer