A JSON-P request issued by jQuery assigns a callback=somerandomnumber parameter, so as not to conflict with other calls that could potentially be happening at the same time. Unfortunately this means a sql result is never cached. Fortunately the same problem does not exist for tiles, image sources can be assigned cross-domain.
The solution is to explicitly set a callback function name instead of letting jquery assign one when making sql api requests. Make sure to pick something unique to the sql request, like ac{term} for an autocomplete request for {term}.
$.getJSON(
"http://blahblahblah.cloudfront.com/api/v2/sql?" +
"q=select n, v from ac where n~*'\\mPum' or v~*'\\mPum'&callback=acPum",
function(response) {
self.handleAutocomplete(response);
}
);
A JSON-P request issued by jQuery assigns a callback=somerandomnumber parameter, so as not to conflict with other calls that could potentially be happening at the same time. Unfortunately this means a sql result is never cached. Fortunately the same problem does not exist for tiles, image sources can be assigned cross-domain.
The solution is to explicitly set a callback function name instead of letting jquery assign one when making sql api requests. Make sure to pick something unique to the sql request, like ac{term} for an autocomplete request for {term}.