Skip to content

cached getServerSideProps on redirect page #51454

Answered by icyJoseph
hwookim asked this question in Help
Discussion options

You must be logged in to vote

Yeah, next-pwa, by default has something called stale-while-revalidate, https://developer.chrome.com/docs/workbox/modules/workbox-strategies/#stale-while-revalidate, which for GSSP, is a problem.

You need to use https://developer.chrome.com/docs/workbox/modules/workbox-strategies/#network-first-network-falling-back-to-cache:

I have answered to this before: #42405 (comment)

If that helps, please report back and don't forget to mark as answered.

Reposting for visiblity:

/** @type {import('next').NextConfig} */
const runtimeCaching = require("next-pwa/cache");

const nextDataIndex = runtimeCaching.findIndex(
  (entry) => entry.options.cacheName === "next-data"
);

if (nextDataIndex !== -1) {
  

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@hwookim
Comment options

Comment options

You must be logged in to vote
3 replies
@hwookim
Comment options

@icyJoseph
Comment options

Answer selected by hwookim
@icyJoseph
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants