linonetwo / solid-tiddlywiki-syncadaptor

Sync TiddlyWiki to SoLiD Server.
MIT License
18 stars 2 forks source link

Use of service worker : improvement #3

Open bourgeoa opened 5 years ago

bourgeoa commented 5 years ago

I recently come to https://cdn.rawgit.com/abesamma/TW5-editions/78846468/empty.html With a very interesting concept including a serviceworker's handler for use as a webapp

linonetwo commented 5 years ago

I think service worker can cache changes locally, and resent to the server when the client comes back online. Even a user closes his browser, cache won't be clear.

I think SW is useful for sync adaptor, I think we don't need to change the code of sync adaptor, just place SW between sync adaptor and solid, cache POST request if it's offline.

linonetwo commented 5 years ago

Does your link use SW? I didn't find out anything special on it.

Do you mean cache all tiddlers inside SW's cache, and when sync adaptor try to load skinnytiddlers, just load from SW's cache?

bourgeoa commented 5 years ago

No I don't use it. Abesamma uses it. His code is not on GitHub, you can see it in his tiddlywiki app .

linonetwo commented 5 years ago

Seems NSS will return 304 Not Modified if the tiddler you GET is the same as local one?

linonetwo commented 5 years ago

getSkinnyTiddlers

My basic idea is loading important tiddlers first, those tiddlers mentioned in $__DefaultTiddlers, and maybe plugins and macros.

Then tiddlers mentioned in $__DefaultTiddlers mentioned tiddlers (2nd order mention).

Then load tiddlers from new to old.