I had a look at JsonpRequest and JsonpRequestBuilder provided by GWT
2.0 for cross domain HTTP requests. Very nice, worked right away.

However, there is one serious flaw...

Like many other JSONP implementations, GWT's JsonRequest generates a
unique callback name for each single jsonp request containing a serial
number (e.g., __gwt_jsonp__.I1.onSuccess, __gwt_jsonp__.I2.onSuccess,
and so on). This callback name is appended to the URI of the GET
request, e.g., 
http://service.whatsoever.com/book/12345678?callback=__gwt_jsonp__.I37.onSuccess.

A response header such as "Cache-Control: public, max-age=..." telling
the browser to cache the resource, will not have any effect because
the URI was skewed. Getting one and the same resource (e.g., /book/
12345678) with many different URIs makes browser caching through Cache-
Control impossible.

My proposal for GWT's JsonRequest is to provide an alternative
strategy for generating callback names. If you use a hash value of the
URI rather than a serial number, browser caching through Cache-Control
would work.

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to