We're using a data source to poll XML data into a grid from a rest service that uses the "If-Modified-Since" HTTP request header to identify whether the XML data has changed. This looks to be broken versus Chrome.
Given the following request made via DataSource:
I see the following request header in Chrome:
...and the following request header in Firefox:
Interestingly, if I drop the "dataSource.setRecordXPath()" call, I see this header in Chrome and Firefox:
I tried using a plain old request builder, and it seems to work great in Firefox and Chrome:
Here is the request header from both Firefox and Chrome:
Here are the versions I'm using. I'd quote you the output from the debug console, but I'm just worn out from trying to get it to function.
Given the following request made via DataSource:
Code:
public void refreshOnlyRecentTests() { final Timer timer = new Timer() { public void run() { refreshOnlyRecentTests(); } }; DataSource dataSource = new DataSource("rest/test/instances/by-status/finished/0/33"); dataSource.setRecordXPath("//DartTestInstance"); DSRequest requestParams = new DSRequest(); HashMap<String, String> httpHeaders = new HashMap<String, String>(); httpHeaders.put("If-Modified-Since", "Tue, 01 Feb 2013 02:03:04 GMT"); requestParams.setHttpHeaders(httpHeaders); dataSource.fetchData(null, new DSCallback() { public void execute(DSResponse response, Object rawData, DSRequest request) { // Schedule this whole action again timer.schedule(5 * 1000); }}, requestParams); }
Code:
If-Modified-Since: Thu, 01 Jan 1970 00:00:00 GMT, Tue, 01 Feb 2013 02:03:04 GMT
Code:
If-Modified-Since: Tue, 01 Feb 2013 02:03:04 GMT
Code:
If-Modified-Since: Thu, 01 Jan 1970 00:00:00 GMT
Code:
public void refreshOnlyRecentTests() { final Timer timer = new Timer() { public void run() { refreshOnlyRecentTests(); } }; RequestBuilder request = new RequestBuilder(RequestBuilder.GET, "http://localhost:8080/dart/rest/test/instances/by-status/finished/0/66"); request.setHeader("If-Modified-Since", "Tue, 01 Feb 2013 02:03:04 GMT"); try { request.setCallback(new RequestCallback() { public void onError(Request request, Throwable e) {} public void onResponseReceived(Request request, Response response) { timer.schedule(5 * 1000); }}); request.send(); } catch (RequestException e) { SC.warn("REQUEST ERROR: "+e.getClass().getName()+": "+e.getMessage()); } }
Code:
If-Modified-Since: Tue, 01 Feb 2013 02:03:04 GMT
Code:
Chrome 24 Firefox 17 SmartGWT 3.1 GWT 2.5
Comment