Once the search index has been retrieved, it is stored in memory as long as the user remains on the same page, but chances are that the user will move around — so it would be good to store the index in localStorage with a timestamp and have it expire after a day or two. We could open the expiration time in the public method so that users can adjust the expiration time of the cache to match the frequency with which the website content is updated/added to.
Once the search index has been retrieved, it is stored in memory as long as the user remains on the same page, but chances are that the user will move around — so it would be good to store the index in
localStorage
with a timestamp and have it expire after a day or two. We could open the expiration time in the public method so that users can adjust the expiration time of the cache to match the frequency with which the website content is updated/added to.