On using a CDN

182 views
Skip to first unread message

Arlen Beiler

unread,
May 9, 2017, 11:23:21 AM5/9/17
to TiddlyWiki
Yes, yes, I know. TiddlyWiki is supposed to be a single file architecture. And it is. And it will be when I am done with this too. So hear me out. 

As I am working on an upgrade to the current TiddlyWiki Cloud Dropbox saver. I keep thinking that there has to be a better way than uploading 1.5 MB every time. I know full well what most of that space is. Its mostly one very crucial and important plugin that never changes without an official release of TiddlyWiki. Because it IS TiddlyWiki. I am of course referring to $:/core. 

It weighs a whopping 1.2 MB. Not much compared to some libraries, but it is a bit. And I wonder if there isn't some way that we can put that file somewhere online so that as we get into Federation and more online hosting and collaboration using TiddlyWiki, we don't have to keep GBs of TiddlyWiki Core 5.1.14 (and then 15, and so on) in our cache and constantly redownloading it everytime we visit a new website. 

That's the main point. TiddlyWikis that are hosted online don't need to contain their own copy of the core. They should be able to use the copy that get's downloaded from the CDN, since then you can cache that copy and use it on every website you visit. 

We could add a second button in the Control Panel that would allow you to download a TiddlyWiki with a reference to the correct version on the CDN instead of the including the core in the download. There should also be an easy way for the renderer to know whether it is supposed to add the core or include the link. 

I think the link should be in head and I don't know for sure but I am imagining that it would use the preloadTiddlers mechanism. Or it should be included directly before bootprefix or which ever script tag brings in the preloadedTiddlers.

Anyway, thoughts?

-Arlen

Lost Admin

unread,
May 9, 2017, 12:18:54 PM5/9/17
to TiddlyWiki
My first thought is, there goes the privacy of using TiddlyWiki. Google isn't free. You pay by giving up your privacy. Granted, I don't have anything on a publicly accessible tiddlywiki site that is all that private but I do use it at home and it is nobody's business but mine what I keep there or when I access it.

Which CDN do you propose to host it? What happens when it gets hacked and all of us suddenly have exploit code inside our tiddlywikis? What happens if the country that the CDN is in decides to order them to include spyware? What happens if the country it is in outlaws consumer encryption, are we going to lose the 'encrypt tiddler' option? Are we still going to see the button but not know about the backdoor that got forced to be put in?

If that doesn't sell you, and plenty of people have given up on having any personal privacy or real security so I accept it may not.

My tiddlywiki at home works even when the Internet connection goes down. Even if I have a completely empty cache. It works on my laptop locally when there is no wifi. Tiddlywiki just works and that is a big selling point for me.

Finally, gzip an empty.html tiddlywiki. How big is it now? Because that is the size that actually matters. Modern web browsers and web servers (all the big ones like iis, apache, nginx, and even lighttpd) all support compressing static content before delivery. So, what actually goes across the wire on a properly configured web server is considerably less that the uncompressed file size if the web server was configured to support it.

PMario

unread,
May 9, 2017, 12:47:53 PM5/9/17
to TiddlyWiki
Just as an info.

tiddlywiki.com ... over the wire 1.34 MByte   ... file size 4 MByte
empty.html ... 395 KB ... 1.86 MB

according to FireFox dev-tools.

-m

Mark S.

unread,
May 9, 2017, 1:00:31 PM5/9/17
to TiddlyWiki
I noticed this when I was testing twederation. I don't know that the server I use compresses data and even if it did I'm sure the host provider is counting final file size, not compression stream.

I think if it could be configured so the user gets to choose whether TW uses an external library, and what library that is, that it would satisfy the demands for security and privacy.

I would assume that the default core would be at TiddlyWiki.com, but people might put their own library on a server that was closer.

-- Mark

Mat

unread,
May 9, 2017, 2:07:46 PM5/9/17
to TiddlyWiki
Arlen - an option to have it as a single file OR via CND ,WOULD BE FANTASTIC!

If the CDN is on some Google service, Github, in the coporate local server, in a Beaker Browser or wherever is a whole other matter.

Such a CDN could potetially also host plugins... even "all of them"... and any content for that matter.

Would love to see a proof-of-concept.

<:-)

Arlen Beiler

unread,
May 9, 2017, 2:09:41 PM5/9/17
to TiddlyWiki
Interesting thoughts, all of you.

My first thought is, there goes the privacy of using TiddlyWiki. Google isn't free. You pay by giving up your privacy. Granted, I don't have anything on a publicly accessible tiddlywiki site that is all that private but I do use it at home and it is nobody's business but mine what I keep there or when I access it.

I am not talking about the info stored in each TiddlyWiki, only the core plugin. So I don't really understand what you mean here. I am specifically talking about people that use TiddlyWiki for a website or other online collaboration tool where they are already downloading it over the internet. So that takes out most of these privacy questions, although not all.

Which CDN do you propose to host it? What happens when it gets hacked and all of us suddenly have exploit code inside our tiddlywikis? What happens if the country that the CDN is in decides to order them to include spyware? What happens if the country it is in outlaws consumer encryption, are we going to lose the 'encrypt tiddler' option? Are we still going to see the button but not know about the backdoor that got forced to be put in?

These are very good questions. I first want to say that I don't expect people to use it most of the time for local files because you could be stuck if the internet goes down. This is for public TiddlyWikis that are hosted online and for people who store their TiddlyWikis in a Dropbox account and use the web app that Jeremy and I made for it, as well as any other services that work like that. Not that it would be required, it would only decrease the file size. The linux world uses checksums and hashes to ensure file integrity and authenticity, and I think we could do that automatically here as well (the implementation details I gave above would change). 

A wiki is a complete application. I don't think we can let the user select which version they use, as that is -- and should be -- baked into the HTML file, only whether to get it from the CDN or include it in the file.

It would be easy to have a mechanism in place to allow a person to temporarily load a local copy in case the internet goes down. 

Once again, I don't think this should be the default way. I only think that it could be a benefit to a (hopefully) increasing percentage of users. It would also work well for TiddlyWiki hosting services.

@Mat, your message came in while I was writing this. I will see if I can pull together a proof of concept.

Thanks,
-Arlen

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/dc8b44b6-dbbc-4c0f-b1d6-1113bc9210fc%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Danielo Rodríguez

unread,
May 14, 2017, 7:31:14 AM5/14/17
to TiddlyWiki
Interestingly some of the stuff you have described is what NoteSelf actually does.
We deliver a minimum file , which gets cached the first time you visit it. Then the only things that go back and forth the wire are the tiddlers , which are usually just a few bytes. Basically every server based tiddlywiki edition does this, with the difference that we also work offline without problems.

What you want to do will require separate places to store the tiddlers and the wiki itself or a server side thing that parses the file and delivers just the tiddlers it contains. Of course you will have to send the required tiddlywiki version to get from the CDN because people usually don't update their wikis unless necessary. Again you will need a similar setup to only upload the changed bytes up the wire, which can get so damn hard. I don't think any of those requirements fit well in the Dropbox setup most people uses. If someone wants to serve a public wiki then there are other better options

Arlen Beiler

unread,
May 14, 2017, 6:13:45 PM5/14/17
to TiddlyWiki
Yeah, I believe NoteSelf does work this way in a sense, though I'm not sure if it is separated into multiple files. And it doesn't need to be since you never upload the whole file.

What I am describing, however, is when someone wants to edit their single TiddlyWiki on Dropbox or host a TiddlyWiki online as a static HTML document. Having the core and theme plugins stored on a CDN would decrease the amount of data that needs to be transferred from the host server, and as more TiddlyWiki sites use this method, it will become more likely that an individual will already have the files in their cache, increasing the user experience as well because the site not only navigates very quickly but also loads instantly the first time they visit it [because it is already cached]. 

Here is an example. I'm not sure why, but the MarkDown generator is not including the hyperlinks, so you'll need to copy and paste the links on the page. The relevant script tags are in the head. Note that the tiddlywiki.html file has the rest of the tiddlers in a second file.




--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
Reply all
Reply to author
Forward
0 new messages