Skip to content
Discussion options

You must be logged in to vote

It's time to drop an update here.

There has been some confusion for cacheHandler and cacheHandlers usage. One thing we should state clearly is that you can use both.

In the case of OP here, the problem is serialization. As this issue points out: mrjasonroy/cache-components-cache-handler#29

Next.js 16 stores segmentData as a Map<string, Buffer> and rscData as a Buffer on APP_PAGE cache entries. Plain JSON.stringify converts Maps to {} and loses Buffer identity, so on deserialization segmentData.get() throws

And the solution, as the PR also points out, is to fix the serialization (and deserialization).

Adds custom jsonReplacer/jsonReviver to the Redis ISR handler that preserve Map and Bu…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
7 replies
@ezeparziale
Comment options

@icyJoseph
Comment options

@ellemedit
Comment options

@ezeparziale
Comment options

@icyJoseph
Comment options

Comment options

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

Answer selected by ellemedit
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