Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
145 views
in Technique[技术] by (71.8m points)

javascript - How to override cached data in localStorage properly

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?

question from:https://stackoverflow.com/questions/65888597/how-to-override-cached-data-in-localstorage-properly

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...