We have a site we built using react. There is a search page that does a fetch to our server to get search results in json format. The results are then diplayed. The user then clicks on a result which takes them to another page on our website. Then they click the back button to go back to the search page but now all the results are gone.
If we store the results in localstorage or redux the results will always be there when they go to the search page. So if they go to our home page->search page, when we pull from localstorage they'll be seeing the old stuff.
My question is, is there a way to structure the code so that the results are cached when they do a search but not cached so much that they always appear?