[tw5] LocalStorage vs SessionStorage

In so many things I’ve been playing with lately, I’ve been toying with applying local storage to various things.

Now that I’ve added session storage capability to BASIC Anywhere Machine, I’m revisiting everything I’ve been experimenting with re local storage, and updating to session storage when it makes more sense.

If this kind of thing is of interest to you, keep an eye out for previous posts bubbling up as I migrate certain things from local storage use to session storage use.

2 Likes

C.J.:

Are you logging your “revisiting” insights (perhaps in one of your portals) so you can share them whenever you feel ready to do so?

I frequently find my “beginner” notes get more appreciation since they provide a “roadmap” for those that follow.

Just curious, since I already know I am interested enough in BAM to use it and I have ideas regarding needs swirling around in my head that I don’t want to pester you with at this time.

Cheers,
Hans

1 Like

LocalStorage vs SessionStorage is a trivial thing.

The next thing on my todo is, for both, getting lists of existing keys. Nothing complicated, just needs a little time.

Reference: “Looping over keys” in LocalStorage, sessionStorage

Hey Charlie: Just saw your latest YouTube post, and- as this is a topic of real interest to me -came here looking for more detail about what you mean by “local storage.”

As i understand the options (nicely explained in this article), both Local Storage and Session Storage are indeed quite similar, main diff being term of data persistence in the browser. In either case tho, i don’t quite understand how that might support your stated Design Goal of enabling a “Farm of single-file TiddlyWiki instances for team collaboration/authoring,” unless your team members are all using the same browser instance, which would not be the case in any collaborative TW authoring scenario that i can conceive…

But if you could share more detail about the UseCase you are trying to enable, that would sure help. Certainly is interesting on the face of it. Rock on, mate!

/walt

1 Like

I am just seeing your GG post now after having replied to you over on YouTube.

II’ll just quickly mention here again that, to me, every TiddlyWiki instance should be single-author and everybody who isn’t author has view-only reader access.

However, it is possible for one person in his/her TiddlyWiki to seamlessly see tiddler content from across all TiddlyWiki instances as if everything was indeed in just the one TiddlyWiki.

Everybody sitting at their own computers, wherever they are. All that is needed is view-only access to all the other TiddlyWiki’s.

Huge amount of intertwingled details up in this old sponge, so hard to explain concisely …

Forgot to mention, LocalStorage vs SessionStorage.

A particular thing worth noting about SessionStorage is that not only are the key-value pairs gone when the browser tab is closed, but the session storage created/accessed by whatever page in that browser tab can only be accessed by that page in the browser tab. So very private to that tab, not available to pages in other tabs, even if those pages are same site origin.

However, just as for LocalStorage, SessionStorage is available to whatever other pages in iframes in the page of a browser tab. So very cool for real-ish-time communication and sharing between all things within that browser tab (say TiddlyWiki and a bunch of things hosted in that TiddlyWiki via iframes) and the current session.

My first goal was to setup a mechanism to allow viewers of a published TiddlyWiki (well, a TiddlyWiki instance located on some website for viewing) to personalize the appearance of a TiddlyWiki and saving those configuration settings to local storage, such that a viewer’s preferences are applied on every visit to the TiddlyWiki instance.

Proof-of-concept prototype working: A tester: Saving TiddlyWiki config settings to local storage

I was thinking about adding add a few more configuration items that can be saved to local storage. “Sexier” configuration items.

But, unless there is interest in that, I believe I’m going to move on to an intriguing proposition:

A TiddlyWiki instance with a BASIC Anywhere Machine program that compares two specified TiddlyWiki instances, comparing existence of corresponding tiddlers in both TiddlyWiki sources, and also comparing modifications dates of tiddlers. A job involving session storage.

Well, if anybody already knows of something out there that does a tiddler-by-tiddler comparison of two TiddlyWiki instances, let me know.

2 Likes