enable client side caching for plot requests

Doesn't work perfectly yet, because the height/width sometimes changes
by one or two pixels.
This commit is contained in:
2018-04-29 19:16:13 +02:00
parent 024c14435c
commit 2903b5a828
5 changed files with 73 additions and 11 deletions

View File

@@ -4,4 +4,6 @@ db.base=${base.dir}/db
path.tmp=${base.dir}/tmp
path.output=${base.dir}/out
cache.images.duration.seconds=3600
logging.config=classpath:log4j2.xml

View File

@@ -908,7 +908,10 @@ function sendPlotRequest(query){
};
data.searchBar.imagelink = '';
postJson("plots", request, success, error);
const requestParam = {
'request': JSON.stringify(request)
};
getJson("plots", requestParam, success, error)
}
function updateImageLink(query) {
@@ -1002,7 +1005,10 @@ function createDashboardItem(originalQuery, field, imageHeight, imageWidth)
data.dashboard.progress.value++;
createDashboardItem(originalQuery, field, imageHeight, imageWidth);
};
postJson("plots", request, success, error);
var requestParam = {
request: JSON.stringify(request)
};
getJson("plots", requestParam, success, error)
}
}
@@ -1045,7 +1051,8 @@ function getJson(url, requestData, successCallback, errorCallback) {
type: "GET",
url: url,
data: requestData,
contentType: 'application/json'
contentType: 'application/json',
cache:true
})
.done(successCallback)
.fail(errorCallback);