Open hazeledmands opened 10 years ago
Maybe instead of using global window.localStorage
, we should be able to configure the cache provider, or even maybe define our own $cacheFactory? For example, see option storageImpl
in angular-cache plugin .
Or maybe even we could just use angular-cache
plugin? It seems like being very optimised and well tested. On the other side, this would be an additional dependency to this project.
Perhaps some feature detection decides whether to use IndexedDB (preferred) and then localStorage (fallback). Means that the cache needs to work asynchronously. (We're most of the way there already).
Why avoid localStorage?