67P / kredits-contracts

:warning: [MOVED] Smart contracts and JS API for Kosmos Kredits
https://gitea.kosmos.org/kredits/contracts
4 stars 4 forks source link

IPFS usage roadmap #148

Closed raucao closed 2 years ago

raucao commented 5 years ago

Discussed with @bumi yesterday about how to proceed with IPFS and caching in kredits-web. There are multiple different sides to it. Current planned steps:

Steps 1 and 2 would be the first phase, in order to not load the same IPFS documents over and over again in kredits-web. The second phase is then to make the architecture fully decentralized:

This solves the basic problems and also makes the entire application completely unhosted/decentralized again, as anyone can use it from any source they want, with any IPFS and Ethereum node, and no write permission needed on a specific IPFS gateway.

Afterwards, to further improve caching and loading times, we can then easily implement a ServiceWorker, which caches the documents in the application cache and intercepts the fetch requests before they even try to validate anything.

raucao commented 5 years ago

Just FYI: edited/updated the original post considerably. This comment is just for notifications to work.

raucao commented 5 years ago

PR for the gateway config: https://gitea.kosmos.org/kosmos/chef/pulls/76

raucao commented 5 years ago

So, now that we tested GET requests with caching, it turns out those are still quite slow, even just loading all data from disk (on my few-years-old SSD). So we should probably implement IndexedDB caching soon (which is easy, as we never have to invalidate the cache). Alternatively, we could try ServiceWorker's application cache.