DEV Community

Discussion on: Caching Data in frontend

Collapse
 
edisonywh profile image
Edison Yap

Cool article! I'm curious to how cache invalidation works though?

Collapse
 
zeerorg profile image
Rishabh Gupta • Edited

Currently only session storage has automatic data clearance where data is removed if a user closes the tab.
If you are using state management framework or passing data around a single page app then as soon as you navigate away from that page your data will be cleared. Both localstorage and indexed db store data for as long as possible.