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:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user