Permit CORS preflight caching

Permit CORS preflight caching

With this argument, an incrementing query parameter is added to the URL, which prevents a browser from utilising the CORS preflight cache.

The jQuery documentation states:

If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending “_={timestamp}” to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET.

The message_bus middleware implementation sets the correct headers to prevent the browser caching the actual response so it is unnecessary for the JavaScript client to also force a cache miss in a way that doubles request throughput in a use-case which requires CORS.

Fixes #245

diff --git a/assets/message-bus.js b/assets/message-bus.js
index 4f215ad..1261e2c 100644
--- a/assets/message-bus.js
+++ b/assets/message-bus.js
@@ -225,7 +225,6 @@
         "/poll" +
         (!longPoll ? "?dlp=t" : ""),
       data: data,
-      cache: false,
       async: true,
       dataType: dataType,
       type: "POST",

GitHub sha: 5c017154

This commit appears in #246 which was approved by SamSaffron. It was merged by SamSaffron.