I need to cache a list of items that is not going to change very often. I realized that I can cache it in the browser and I asked myself how do I force the stored data to be overridden. I thought about naming the key as a datestamp and every time that I want to replace it, I'd just change the key to a newer datestamp, e.g localStorage.setItem("25/01/2021", "['John','Bryan','Mark'..]") Is this way practical? What is the customary way to do it?
localStorage.setItem("25/01/2021", "['John','Bryan','Mark'..]")
2.1m questions
2.1m answers
60 comments
57.0k users