You can use a special template to externalise TiddlyWiki's core code into a separate file. This configuration allows the browser to cache the core for improved efficiency.
However, there is some inefficiency in this arrangement because the core code is repeatedly loaded and saved every time the content of the wiki is saved. This inefficiency is partially ameliorated when working in the client server configuration because once the wiki is loaded by the browser the synchronisation process only transmits individual tiddlers back and forth to the server.
The remaining inefficiency when working in the client server configuration is that the single page wiki that is initially loaded will contain a copy of the entire core code of TiddlyWiki, making it impossible for the browser to cache it.
The mechanism is activated by setting the root-tiddler parameter to
tiddlywiki YOUR_WIKI_FOLDER --listen 'root-tiddler=$:/core/save/all-external-js' use-browser-cache=yes
The provided edition
tiddlywiki ./myNewWiki --init server-external-js tiddlywiki ./myNewWiki --build listen
The above commands perform the following:
If you start your TiddlyWiki server in the "external-js" configuration, snapshots you save from the wiki will also have the external-js configuration.
The "server-external-js" edition lets you save the snapshot from the command line:
tiddlywiki YOUR_WIKI_FOLDER --build index
tiddlywikicore-5.x.x.js will be saved in your wiki folder's
tiddlywikicore-5.x.x.js will be saved in the
output directory of your wiki folder:
tiddlywiki YOUR_WIKI_FOLDER \ --render '$:/core/templates/tiddlywiki5.js' \ '[[tiddlywikicore-]addsuffix<version>addsuffix[.js]]' \ 'text/plain'
The "server-external-js" edition has a shortcut for the BuildCommand to do the same thing:
tiddlywiki YOUR_WIKI_FOLDER --build tiddlywikicore
$:/config/SaveWikiButton/Templateby deleting any custom copy. Save your wiki and you are done.
$:/core/save/offline-external-js. Modify if necessary.