From 2c9354dce9f3734557cc9be8a8b5f775f5bddd1b Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Thu, 8 May 2014 22:35:46 +0200 Subject: [PATCH] api cache prevention --- js/api/ConnectAPI.js | 9 +++++++-- js/api/NetworkAPI.js | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/js/api/ConnectAPI.js b/js/api/ConnectAPI.js index 39b08c3..605de86 100644 --- a/js/api/ConnectAPI.js +++ b/js/api/ConnectAPI.js @@ -23,7 +23,7 @@ function ConnectAPI() { var _timeoutTime = 3000; var _refreshDelay; - var _refreshInterval = 3000; + var _refreshInterval = 5000; var _running; var _listChanged = false; @@ -45,6 +45,7 @@ function ConnectAPI() { type: "GET", dataType: 'json', timeout: _timeoutTime, + cache: false, success: function(response){ //console.log("ConnectAPI:list response: ",response); if(response.status == "error" || response.status == "fail") { @@ -126,7 +127,11 @@ function ConnectAPI() { // check if all found boxes are alive jQuery.each(foundBoxes, function (index,foundBox) { - checkBox(foundBox); + if(foundBox === _apBox) { // don't recheck apBox + addBox(foundBox); + } else { + checkBox(foundBox); + } }); if(foundBoxes.length == 0 && _self.listUpdated) { diff --git a/js/api/NetworkAPI.js b/js/api/NetworkAPI.js index 83a4dac..12befa5 100644 --- a/js/api/NetworkAPI.js +++ b/js/api/NetworkAPI.js @@ -202,6 +202,7 @@ function NetworkAPI() { type: "GET", dataType: 'json', timeout: timeoutTime, + cache: false, success: function(response){ //console.log("NetworkAPI:alive response: ",response); if(response.status == "error" || response.status == "fail") {