how to cache local storage jsonstringify javascript code example Example: set localstorage value localStorage.setItem("mytime", Date.now());