From 646608bf8b6e824ef2ecc45d017831f7c4840a1e Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 17 Nov 2016 17:27:21 +0000 Subject: [PATCH] Add a cachebuster to /version --- src/vector/platform/WebPlatform.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/vector/platform/WebPlatform.js b/src/vector/platform/WebPlatform.js index b5459aec871..dec15869e7f 100644 --- a/src/vector/platform/WebPlatform.js +++ b/src/vector/platform/WebPlatform.js @@ -128,8 +128,18 @@ export default class WebPlatform extends VectorBasePlatform { _getVersion() { const deferred = q.defer(); + + // We add a cachebuster to the request to make sure that we know about + // the most recent version on the origin server. That might not + // actually be the version we'd get on a reload (particularly in the + // presence of intermediate caching proxies), but still: we're trying + // to tell the user that there is a new version. request( - { method: "GET", url: "version" }, + { + method: "GET", + url: "version", + qs: { cachebuster: Date.now() }, + }, (err, response, body) => { if (err || response.status < 200 || response.status >= 300) { if (err == null) err = { status: response.status };