I'm using NextJS 14 for my app and I want to have this behavior:
- When the user goes to a different page, there should be a full navigation (escaping the SPA behavior).
- When the user clicks the browser's back button, the previous page and its cached state should load. So if I assign this page a unique ID, it should be the same idea ID that was there previously.
However, I'm running to an issue getting this to work. I can have the previous state maintained if I use the <Link> component, but then it doesn't do a full page load. If I use the <a> tag, I get the full page load, but instead of the page being loaded from the bfcache, it makes another request to the server.
Is there any way I can fix this? Apologies if anything doesn't make sense, I don't have the best mental model of it.