diff --git a/configs/client-default.js b/configs/client-default.js index bc5c9b73..48404e2b 100644 --- a/configs/client-default.js +++ b/configs/client-default.js @@ -303,9 +303,7 @@ module.exports = function(options) { { packagePath: "plugins/c9.ide.language/language", workspaceDir: workspaceDir, - staticPrefix: hosted && !options.packed - ? options.ideBaseUrl + "/uph" + staticPrefix - : staticPrefix, + staticPrefix: staticPrefix, workerPrefix: options.CORSWorkerPrefix // "/static/standalone/worker" }, "plugins/c9.ide.language/keyhandler", diff --git a/node_modules/ace/lib/ace/worker/worker_client.js b/node_modules/ace/lib/ace/worker/worker_client.js index ba4f20a0..b69071fb 100644 --- a/node_modules/ace/lib/ace/worker/worker_client.js +++ b/node_modules/ace/lib/ace/worker/worker_client.js @@ -48,12 +48,13 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) { if (config.get("packaged") || !require.toUrl) { workerUrl = workerUrl || config.moduleUrl(mod, "worker"); } else { + var skipBalancers = true; // load all scripts from one domain, workers don't support CORS headers var normalizePath = this.$normalizePath; - workerUrl = workerUrl || normalizePath(require.toUrl("ace/worker/worker.js", null, "_")); + workerUrl = workerUrl || normalizePath(require.toUrl("ace/worker/worker.js", null, "_", skipBalancers)); var tlns = {}; topLevelNamespaces.forEach(function(ns) { - tlns[ns] = normalizePath(require.toUrl(ns, null, "_").replace(/(\.js)?(\?.*)?$/, "")); + tlns[ns] = normalizePath(require.toUrl(ns, null, "_", skipBalancers).replace(/(\.js)?(\?.*)?$/, "")); }); } diff --git a/node_modules/architect-build/build_support/mini_require.js b/node_modules/architect-build/build_support/mini_require.js index 2eadd52a..87186077 100644 --- a/node_modules/architect-build/build_support/mini_require.js +++ b/node_modules/architect-build/build_support/mini_require.js @@ -152,8 +152,8 @@ var activateModule = function(name) { var req = function(path, callback) { return _require(name, path, callback); }; - req.toUrl = function(namePlusExt) { - return require.toUrl(normalizeName(name, namePlusExt)); + req.toUrl = function(namePlusExt, _1, _2, skipBalancers) { + return require.toUrl(normalizeName(name, namePlusExt), null, null, skipBalancers); }; req.config = require.config; @@ -315,7 +315,7 @@ function undefAll(module, hash) { require.MODULE_LOAD_URL = MODULE_LOAD_URL; -require.toUrl = function(moduleName, ext, skipExt) { +require.toUrl = function(moduleName, ext, skipExt, skipBalancers) { var absRe = /^([\w\+\.\-]+:|\/)/; var index = moduleName.indexOf("!"); if (index !== -1 || !ext || /^\/|\.js$/.test(moduleName)) @@ -347,7 +347,7 @@ require.toUrl = function(moduleName, ext, skipExt) { if (!absRe.test(url)) { url = (config.baseUrl || require.MODULE_LOAD_URL + "/") + url; } - if (url[0] === "/" && config.baseUrlLoadBalancers) { + if (url[0] === "/" && config.baseUrlLoadBalancers && !skipBalancers) { var n = Math.abs(hashCode(url)) % config.baseUrlLoadBalancers.length; url = config.baseUrlLoadBalancers[n] + url; } diff --git a/package.json b/package.json index 90eb43b2..d31197f5 100644 --- a/package.json +++ b/package.json @@ -114,6 +114,6 @@ "c9.ide.threewaymerge": "#229382aa0b", "c9.ide.undo": "#b028bcb4d5", "c9.ide.upload": "#0bd010d3dc", - "c9.ide.welcome": "#412fe300da" + "c9.ide.welcome": "#7450aebef6" } } \ No newline at end of file diff --git a/plugins/c9.static/unpacked_helper.js b/plugins/c9.static/unpacked_helper.js index 15a3fe9a..c5bb48ef 100644 --- a/plugins/c9.static/unpacked_helper.js +++ b/plugins/c9.static/unpacked_helper.js @@ -1,3 +1,9 @@ +/** + * unpacked_helper speeds up the unpacked version of Cloud9 + * by using more parallel connections and avoiding + * subsubdomains on dogfooding (e.g., ide.dev-lennartcl.c9.io, where + * Chrome doesn't support any caching). + */ "use strict"; plugin.consumes = [ @@ -18,20 +24,11 @@ function plugin(options, imports, register) { assert(ideBaseUrl, "ideBaseUrl must be set"); var balancers = [ - baseUrl + "/uph", + baseUrl + "/_unp", + baseUrl + ":8080/_unp", + baseUrl + ":8081/_unp", + baseUrl + ":8082/_unp", ]; - /* UNDONE: for now we put all static content on one domain - because of reports of CORS errors - if (!options.avoidSubdomains) - balancers.push( - ideBaseUrl - // We could include others but dogfooding URLs like - // vfs.newclient-lennartcl.c9.io don't have a cert, so - // let's not - // apiBaseUrl + "/uph", - // vfsBaseUrl + "/uph" - ); - */ connectStatic.getRequireJsConfig().baseUrlLoadBalancers = balancers; assert(connectStatic.getRequireJsConfig().baseUrlLoadBalancers); diff --git a/server.js b/server.js index f5537a91..5616c5ac 100755 --- a/server.js +++ b/server.js @@ -29,7 +29,12 @@ var shortcuts = { "s": ["standalone", "-s", "standalone"] }; shortcuts.odev = shortcuts.onlinedev; // For backwards compatibility, if you see this in 2016 remove this line -var delayLoadConfigs = ["preview", "user-content", "api", "oldclient", "apps-proxy", "worker"]; +var delayLoadConfigs = [ + // Services that are usually not immediately needed + "preview", "user-content", "api", "apps-proxy", "worker", + // Services that are very slow to load, blocking others + "profile", +]; module.exports = main;