You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had some undesirable behaviour when users are submitting a change to the backend and then navigate to a different page that shows same backend content. Outdated cache of the service worker was the issue, i.e. service worker cached .json content for the page was served instead of making a new request to the network to fetch updated content as I would expect with SSR and seems default next js behaviour without next-pwa installed.
I find following strategy not ideal for pages that are SSR in cache.js:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I had some undesirable behaviour when users are submitting a change to the backend and then navigate to a different page that shows same backend content. Outdated cache of the service worker was the issue, i.e. service worker cached .json content for the page was served instead of making a new request to the network to fetch updated content as I would expect with SSR and seems default next js behaviour without next-pwa installed.
I find following strategy not ideal for pages that are SSR in cache.js:
Instead of handler 'StaleWhileRevalidate', I was able to avoid above issues use the handler 'NetworkFirst' instead:
Should 'NetworkFirst' be the default for the urlPattern //_next/data/.+/.+.json$/i or at least for all SSR pages?
Beta Was this translation helpful? Give feedback.
All reactions