unlock-protocol / unlock

Ʉnlock is a protocol for memberships built on a blockchain.
https://unlock-protocol.com
MIT License
839 stars 248 forks source link

Start taking advantage of localStorage for locks/transactions etc. #1975

Closed cnasc closed 5 years ago

cnasc commented 5 years ago

Right now it takes a very long time to initialize the app state on pageload. We should investigate the use of localStorage to cache things like locks and transactions so that the page is ready to go very quickly. We can also store the last blockNumber we queried, so that we can do delta updates instead of walking the whole chain (which will only take longer and longer as time goes on).

benwerd commented 5 years ago

We actually had this for a long time and then removed it! There's probably a sweet spot - but it also introduced some weird errors / inconsistencies. In reality we would need to check localStorage against the chain every time anyway.

julien51 commented 5 years ago

Ha! Are you running locksmith? This is one of the features: it caches transactions so you load them from there !