Imagine that I have a Next.js app which uses ISR to temporarily render some content on the home page. This content is interactive and I would maintain the client state in a Context. Every 24 hours, I would like to regenerate this interactive content at which point I would like to clear the state.
I don't actually have this app right now (I'm in the planning stage) but the best example of this that I can think of is Wordle where a word gets generated once every 24 hours and you need to guess it; if you are in the process of guessing the word when this reset happens, your guessing attempts are going to be reset back to zero (although I haven't checked this).
I thought that I could have a scheduled Firebase function that would update my content and call an endpoint that would trigger an on-demand revalidation as described here, however, I still don't know how I could reset the client state during/after this revalidation. Any ideas or suggestions?
Many thanks in advance!