Closed foxter111 closed 1 year ago
I've noticed the exact same thing. My homepage has dynamic elements, and deleting an element removes it from the list(and DB), but if I close and reopen the app, the original list still appears. Refreshing the page brings in the new, correct list.
I presume this may be related to some type of caching within next-pwa, but I haven't nailed it down.
Digging around in old issues, I found this thread.
Basically, next-pwa will check the cache first for getServerSideProps
values. Changing next-data
it to NetworkFirst
instead of StaleWhileRevalidate
overrides this behavior.
@bruceharrison1984 Yes, you are right. I changed next-data
and it works for me. Thank you.
Hello everyone. I have a problem with my page props. Sometimes, my page get previous props, although I see, that getServerSideProps passes correct values.
I have a page that render different content depending on the type of user. I get type of user in getUserTypeServer and pass it to the page.
My code for example:
How To Reproduce
1) Log in for user 2) Go to the page 3) Logging out 4) Log in for admin 5) Go to the page
I think, that this bug appear after install next-pwa for my app. My page gets previous props and renders a component for ordinary user, although getUserTypeServer passes a correct type.After reload page, it gets correct props and renders a component for admin. I think, it can be caching, but I don't know, how I can fix it. Does somebody help me? .
My next.config:
Version libraries: "next": "12.2.2", "next-pwa": "5.5.4",