[Discussion] How to reduce the size of your Tiddlywiki

Thanks, this is helpful. Is it possible to do the same with plugins?

Much appreciated! For online websites with single page TW, this is a gold tip!

2 Likes

I dont know to be honest, in theory it should be possible but I’m not sure how to do that, if someone has a solution this would be great!

Yes especially for mastodon verification, since the check process only work on page size < 1MB

1 Like

A great nuisance! It would be a great improvement if they just required that the link be in the first 1MB of the file.

For verifying the TiddlyWiki Mastodon account I was wondering about making a static tiddler rendering at https://tiddlywiki.com/about, and then linking to that from the profile.

1 Like

The next question is whether this will work with TiddlyHost. I imagine there’s a lot of people that would like to post their verification link on the same page they regularly maintain.

Edit: I was afraid there might be a CORS complication, but it seems to work using TH with a library hosted on GH pages. The save is so fast (with an admittedly empty file) that the “Saving” notice is still on the screen when the “Saved” notice appears.

Edit 2: And now it can be used for Mastodon verification

image

2 Likes

Please correct me if I’m wrong.

This won’t help in reducing the load time of your TW. The browser will still have to load the massive JS file to render the page.

The only advantage is that this trick helps is reducing the disk space usage.

According to the wiki this should reduce the loading time once the js is cached by your browser, but the first load will not be different yes

2 Likes

The save is also very fast. I always like to wait for a save to complete before moving on to other tasks.

4 Likes

I tried this, but Tiddloid cannot load the external Javascript file.

To “undo”, upgrade the html file and delete $:/config/SaveWikiButton/Template.

I thought your question was my question too… but then the rest of your post (@Mark_S) seemed to be about Mastodon (about which I know nothing).

What about the basic question: Can tiddlyhost users work with this more efficient storage method?

Since I tend to work with multiple tiddlyhost projects, my guess is that load and save time would be significantly reduced by loading the core code just once per session…

Meanwhile: Maybe tiddlyhost could even save lots of storage overall by letting users have just one centralized core file (or one per active version). But I have no clue whether a more savvy user could already set this up on tiddlyhost, nor how difficult it would be to tweak tiddlyhost on the server end to make this efficient solution available…

Consider our prior discussion of recommending Tiddlyhost accounts for new users: If tiddlyhost made such core-separation the default for free accounts (assuming there’s no extra configuration needed), this might radically reduce storage “clutter” for trial users who may or may not go on to do much with TW. Of course, the path to downloading a fully integrated single-file version would need to be clear, if Tiddlyhost is seen as a stepping-stone for those who may then graduate to other storage methods.

2 Likes

It seems like tiddlyhost is already doing something to compress tiddlywiki files, but yes there are gains that could be made: Tiddlywiki with external js take 0,03 MB on tiddlyhost vs 0,41 MB for a standard wiki (latest prerelease for both).

It doesnt work however, I get the message “Error: Cannot load http://www.telumire.be/TW/prerelease/tiddlywikicore-5.2.4-prerelease.js”

https://tiddlywiki-5-2-4-prerelease-external-js.tiddlyhost.com/

EDIT: maybe this is because of a CORS issue the file needed to be served over https

It works with Tiddloid and a remote hosted library file. It might also work with a local file, but you’ll have to put the library file in a universal location (e.g. “Download”) and work out the exact path on your system to the file. AFAIK, Tiddloid won’t let you store non-TW files in its personal directory (this is pretty much the standard on Android).

Hmm. Works for me. I think your path needs to be https: though.

Here’s the site I set up:

https://remotest-ideas.tiddlyhost.com/

1 Like

Thanks @Mark_S , that was it ! I will mark this wiki as a template, it will be easier for tiddlyhost users to use

I thought my edit clarified that it was indeed possible to host on TH. But it might be clearer in my mind than in my text :wink:

Save time is definitely faster. There’s a theory that your browser can cache the library, so, if that is true, then loading should also be faster after the first load.

Yes, just have to convince simon to serve the libraries at a known location. It would probably only be applicable to 5.2.3 and on. It might reduce the load on the servers if the cached library theory is true. That is, after the first load, the user wouldn’t be pulling the library.

1 Like

Maybe this could be officially be done on the TW5 github repo itself ? Apparently github page can be used as a CDN: Github as a CDN | Lance Pollard

But maybe a true CDN would be best : https://cdnjs.com/ for example, it’s free and opensource. I will create a PR for this

I did think you implied as much, but I didn’t follow the details. I think I understand that you’re working with a core library hosted at Github. Setting up a Github core library doesn’t sound straightforward for me…

But do we each need to host our core library somewhere? That seems redundant…

Should there be some central place (like tiddlywiki.com) where the core (or at least the current version) can be available to any of us who wish to use this method?

[Edit: I think I understand that setting such a thing up is exactly what some of the later posts are aiming to do.]

-Springer

1 Like

If you’re using github pages, then all we are talking about is a static host of the TW core library file (which you obtain per the instructions in the how-to) on github pages. It’s just a hosted file. If you have some other place to host the file, that could work too. But there seem to be fewer and fewer free places where you can do that.

Yes. But early days … probably need to see how well it works first.

2 Likes

As CDN - Content delivery network was mentioned I want to point out even whole tiddlywiki files load quicker “internationally” using the free CloudFlare CDN

  • It also makes sense we have any sharable resource such as the seperate JAVAscript core that we have this on a CDN somewhere. Ideally this will be done on an appropriate CDN and domain name. As suggested under tiddlywiki.com or similar, and publish it for all.

However regardless of the speed enhancing methods you use, always keep in mind this will not always work enough for users on low bandwidth and there is value still installing a splash screen or look at static html landing pages etc…

1 Like