Allow cliend-side caching
Add Expires and Cache-Control headers to API responses. This allows browsers to cache them and avoid extra round-trips for data. Also use plain JSON type in UI to allow browser to use cache. For widget to work added "Access-Control-Allow-Origin: *" header to all API requests. Note that althogh this will make cross-origin requests work, it's still not enough to make browser cache such response, so widget won't benefit from client-side caching yet. Change-Id: I49eeffccaf79fe3417bd941590b5dd239ddc433f
This commit is contained in:
@@ -89,7 +89,7 @@ function renderTableAndChart(url, container_id, table_id, chart_id, link_param,
|
||||
|
||||
$.ajax({
|
||||
url: makeURI(url),
|
||||
dataType: "jsonp",
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
|
||||
var tableData = [];
|
||||
@@ -325,7 +325,7 @@ function initSingleSelector(name, api_url, select2_extra_options, change_handler
|
||||
|
||||
$.ajax({
|
||||
url: api_url,
|
||||
dataType: "jsonp",
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
var initial_value = getUrlVars()[name];
|
||||
if (initial_value) {
|
||||
|
Reference in New Issue
Block a user