Skip to content

LocalStorage Based persistent cache with Nextjs #2091

Discussion options

You must be logged in to vote

it was so much simpler to solve than I imagined

simply on the server side I returned an empty Map instance, and on the client side a Map based on localstorage for the provider (using typeof window !== 'undefined') kkkkkk

I haven't been able to do this before because I figured delivering an empty instance without the server side cache would cause an empty delivery to the client too, obviously is wrong kkkk

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by AllanOliveiraM
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants