Next.js Discord

Discord Forum

Caching on prod question

Unanswered
Gharial posted this in #help-forum
Open in Discord
GharialOP
Is that normal that when I build app on localhost my data is refreshing after router.push but not in self hosted production? I'm going to implement revlidateTag but I dont understand how localhost build differs from prod in terms of caching.

8 Replies

@Gharial Is that normal that when I build app on localhost my data is refreshing after router.push but not in self hosted production? I'm going to implement revlidateTag but I dont understand how localhost build differs from prod in terms of caching.
on localhost mostly nothing is cached. In production it's the other way around: most things are cached. Make sure you read the guide on caching from the nextjs docs so you know when to refresh what
GharialOP
but still if I use npm run build & start on locallhost it should work like on prod or no?
GharialOP
it isnt in my case
@Gharial it isnt in my case
you might want to clarify what especially not work
GharialOP
I have router.push on button on form. When I click it using build on prod, url which im redirected to is refreshed. On prod it isnt and my form is not updated.
@Gharial?