mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-30 05:36:58 +00:00
WebServer: Enable deflate and gzip compression (#3677)
* get-index: Enable deflate and gzip compression * Spaces -> Tabs * listen: Add optional `gzip=yes` parameter (defaults to "no") * get-index: Add comment explaining the usage of `zlib.*Sync` instead of async.
This commit is contained in:
committed by
Jeremy Ruston
parent
02fbae4200
commit
049244e8a8
@@ -43,6 +43,8 @@ function Server(options) {
|
||||
$tw.utils.extend({},this.defaultVariables,options.variables);
|
||||
// Initialise CSRF
|
||||
this.csrfDisable = this.get("csrf-disable") === "yes";
|
||||
// Initialize Gzip compression
|
||||
this.enableGzip = this.get("gzip") === "yes";
|
||||
// Initialise authorization
|
||||
var authorizedUserName = (this.get("username") && this.get("password")) ? this.get("username") : "(anon)";
|
||||
this.authorizationPrincipals = {
|
||||
@@ -84,7 +86,8 @@ Server.prototype.defaultVariables = {
|
||||
"tiddler-render-template": "$:/core/templates/server/static.tiddler.html",
|
||||
"system-tiddler-render-type": "text/plain",
|
||||
"system-tiddler-render-template": "$:/core/templates/wikified-tiddler",
|
||||
"debug-level": "none"
|
||||
"debug-level": "none",
|
||||
"gzip": "no"
|
||||
};
|
||||
|
||||
Server.prototype.get = function(name) {
|
||||
|
||||
Reference in New Issue
Block a user