DEV Community

Discussion on: JavaScript Local Storage Explained!

Collapse
 
cicirello profile image
Vincent A. Cicirello

I use local storage for the site search page for my personal website to cache the search index. My site is a static website hosted on GitHub Pages. So without a backend, and without using some 3rd party service, search is run entirely in browser. Obviously can't feasibly do this for a very large site. But index for my site is just under 800 KB.

When using local storage for caching, you do need some mechanism to know when to use cached version and when to make a fresh request.

Collapse
 
kolja profile image
Kolja

RepoLink, please 😃

Collapse
 
cicirello profile image
Vincent A. Cicirello

The GitHub repo is: github.com/cicirello/cicirello.git...

The site itself is at: cicirello.org/