Big news, I've never attempted either. What sort of storage/performance limits are you seeing with OPFS? My past attempts at general caching with IndexedDB were useless because I didn't want to use too much storage. Also, I was not aware of OPFS. How much of this is in snort/system?
Snort v0.2.0 was tagged.
This release contains a full nostr relay in the browser (the worker relay). It works like any other relay on nostr, and allows us to cache content efficiently.
This also means that all reactions, replies, and posts are cached in your browser and are always available, even when you are offline.
Most of the caching strategies that have been developed thus far have been scrapped and replaced by the worker relay.
Additionally, I've added Negentropy support to allow for really efficient synchronization with the worker relay, meaning that very little data is required to stay in sync.
This opens the door for a lot of really cool things.
As always there are many many many changes so if you're interested in the summarised list you can see them on https://snort.social/about
Discussion
Negentropy is part of snort/system, the worker relay is standalone with no dependency on snort/system, its here: https://git.v0l.io/Kieran/snort/src/branch/main/packages/worker-relay/src/sqlite-relay.ts
What percentage of your bundle is sqlite-wasm?
OPFS definitely doesn't have native disk perf, if you use the default DELETE journal mode it can get really slow when inserting events, sometimes 5 or more seconds to write a single event.
Query performance is really good, its far better than indexedDB thats for sure