Hi Deech,
if you set cache to false, like this
res.configureRequest(function(req) {
req.setCache(false);
});
the URL should contain a timestamp, e.g.
?nocache=1327302060065
In the log file you pasted, I don't see any timestamps.
In general, the cacheability of a response is controlled by headers included in
the response. The cache control headers you set on the request may be ignored
by the browser. IE does not seem to honor some or all Cache-Control directives.
Chrome does, sort of.
(See http://www.mnot.net/javascript/xmlhttprequest/cache.html)
The safest way to avoid caching therefore is to append a nocache parameter. The
best way, however, is to fix the service to include appropriate cache control
directives in the response.
I wonder, what is the response of
$ curl -I -X GET <url>
$ curl -I -X GET <url> -H 'If-Modified-Since: Wed, 04 Jan 2012 09:37:18 GMT'
(insert date *after* the file was last modified)
What puzzles me a little is that the browser should actually revalidate the
freshness of the cached resource unless a far future expire date was set. In
other words, even when caching is enabled you should get a fresh representation
of the resource.
Did you try to set Expires: -1 on the response? This should make the browser
treat the response as stale.
Regards
Tristan
Am 20.01.2012 um 23:14 schrieb aditya siram:
> Hi Tristan,
> I have enabled qx.debug.io and the output from both IE and Firefox [1] looks
> the same. I have pasted the output below. You'll notice that the Firefox is
> hitting the localhost while IE is running on a separate machine. The results
> are the same if Firefox is running on a remote machine.
>
> The last line of each output is a printout of what it got from the server.
> The results as you can see are different. Firefox has the updated value while
> IE does not.
>
> In order to control caching on IE when I issue the GET request
> (qx.io.request.Xhr) I set the following headers:
>
> req.setRequestHeader("Cache-Control", "private must-revalidate, max-age=1");
> req.setRequestHeader("Pragma", "private");
> req.setRequestHeader("Expires", (new Date().getTime()+(1000)).toString());
>
> Any help is appreciated. I am out of ideas at this point and will probably
> have to switch to qx.io.remote.Request if I cannot resolve this.
>
> -deech
>
>
>
> [1]
> ====IE======
> 033533 Open low-level request with method: GET, url:
> http://10.28.16.109:8080/xnat/data/config/edit/projects/proj_5/image/dicom/script?format=json,
> async: true
> 033533 qx.bom.request.Xhr: Open native request with method: GET, url:
> http://10.28.16.109:8080/xnat/data/config/edit/projects/proj_5/image/dicom/script?format=json,
> async: true
> 033534 qx.bom.request.Xhr: Received native readyState: 1
> 033534 Fire readyState: 1
> 033535 Send low-level request
> 033535 qx.bom.request.Xhr: Send native request
> 033535 qx.bom.request.Xhr: Received native readyState: 1
> 033547 qx.bom.request.Xhr: Received native readyState: 2
> 033547 Fire readyState: 2
> 033548 qx.bom.request.Xhr: Received native readyState: 3
> 033548 Fire readyState: 3
> 033548 qx.bom.request.Xhr: Received native readyState: 4
> 033549 Fire readyState: 4
> 033549 Request completed with HTTP status: 200
> 033549 Response is of type: 'application/json'
> 033551 Open low-level request with method: GET, url:
> http://10.28.16.109:8080/xnat/data/config/edit/projects/proj_5/image/dicom/status?format=json,
> async: true
> 033551 qx.bom.request.Xhr: Open native request with method: GET, url:
> http://10.28.16.109:8080/xnat/data/config/edit/projects/proj_5/image/dicom/status?format=json,
> async: true
> 033552 qx.bom.request.Xhr: Received native readyState: 1
> 033552 Fire readyState: 1
> 033553 Send low-level request
> 033553 qx.bom.request.Xhr: Send native request
> 033553 qx.bom.request.Xhr: Received native readyState: 1
> 033555 qx.bom.request.Xhr: Received native readyState: 2
> 033556 Fire readyState: 2
> 033556 qx.bom.request.Xhr: Received native readyState: 3
> 033556 Fire readyState: 3
> 033557 qx.bom.request.Xhr: Received native readyState: 4
> 033557 Fire readyState: 4
> 033557 Request completed with HTTP status: 200
> 033557 Response is of type: 'application/json'
> 033561 # Test
>
> =====Firefox=====
> 033760 qx.io.request.Xhr[634-0]: Open low-level request with method: GET,
> url:
> http://localhost:8080/xnat/data/config/edit/projects/proj_5/image/dicom/script?format=json,
> async: true
> Native.js (line 62)
> 033766 qx.bom.request.Xhr: Open native request with method: GET, url:
> http://localhost:8080/xnat/data/config/edit/projects/proj_5/image/dicom/script?format=json,
> async: true
> Native.js (line 62)
> 033769 qx.bom.request.Xhr: Received native readyState: 1
> Native.js (line 62)
> 033771 qx.io.request.Xhr[634-0]: Fire readyState: 1
> Native.js (line 62)
> 033774 qx.io.request.Xhr[634-0]: Send low-level request
> Native.js (line 62)
> 033776 qx.bom.request.Xhr: Send native request
> Native.js (line 62)
> GET
> http://localhost:8080/xnat/data/config/edit/projects/proj_5/image/dicom/script?format=json
> GET
> http://localhost:8080/xnat/data/config/edit/projects/proj_5/image/dicom/script?format=json
> 200 OK
> 40ms
> Xhr.js (line 328)
> 033782 qx.bom.request.Xhr: Received native readyState: 1
> Native.js (line 62)
> 033823 qx.bom.request.Xhr: Received native readyState: 2
> Native.js (line 62)
> 033831 qx.io.request.Xhr[634-0]: Fire readyState: 2
> Native.js (line 62)
> 033835 qx.bom.request.Xhr: Received native readyState: 3
> Native.js (line 62)
> 033838 qx.io.request.Xhr[634-0]: Fire readyState: 3
> Native.js (line 62)
> 033841 qx.bom.request.Xhr: Received native readyState: 4
> Native.js (line 62)
> 033843 qx.io.request.Xhr[634-0]: Fire readyState: 4
> Native.js (line 62)
> 033845 qx.io.request.Xhr[634-0]: Request completed with HTTP status: 200
> Native.js (line 62)
> 033847 qx.io.request.Xhr[634-0]: Response is of type: 'application/json'
> Native.js (line 62)
> 033851 qx.io.request.Xhr[638-0]: Open low-level request with method: GET,
> url:
> http://localhost:8080/xnat/data/config/edit/projects/proj_5/image/dicom/status?format=json,
> async: true
> Native.js (line 62)
> 033854 qx.bom.request.Xhr: Open native request with method: GET, url:
> http://localhost:8080/xnat/data/config/edit/projects/proj_5/image/dicom/status?format=json,
> async: true
> Native.js (line 62)
> 033857 qx.bom.request.Xhr: Received native readyState: 1
> Native.js (line 62)
> 033859 qx.io.request.Xhr[638-0]: Fire readyState: 1
> Native.js (line 62)
> 033861 qx.io.request.Xhr[638-0]: Send low-level request
> Native.js (line 62)
> 033863 qx.bom.request.Xhr: Send native request
> Native.js (line 62)
> GET
> http://localhost:8080/xnat/data/config/edit/projects/proj_5/image/dicom/status?format=json
> GET
> http://localhost:8080/xnat/data/config/edit/projects/proj_5/image/dicom/status?format=json
> 200 OK
> 37ms
> Xhr.js (line 328)
> 033870 qx.bom.request.Xhr: Received native readyState: 1
> Native.js (line 62)
> 033908 qx.bom.request.Xhr: Received native readyState: 2
> Native.js (line 62)
> 033913 qx.io.request.Xhr[638-0]: Fire readyState: 2
> Native.js (line 62)
> 033916 qx.bom.request.Xhr: Received native readyState: 3
> Native.js (line 62)
> 033918 qx.io.request.Xhr[638-0]: Fire readyState: 3
> Native.js (line 62)
> 033921 qx.bom.request.Xhr: Received native readyState: 4
> Native.js (line 62)
> 033924 qx.io.request.Xhr[638-0]: Fire readyState: 4
> Native.js (line 62)
> 033926 qx.io.request.Xhr[638-0]: Request completed with HTTP status: 200
> Native.js (line 62)
> 033929 qx.io.request.Xhr[638-0]: Response is of type: 'application/json'
> Native.js (line 62)
> 033935 # Test updated
>
>
>
>
>
> On Wed, Jan 18, 2012 at 10:38 AM, Tristan Koch <[email protected]> wrote:
> Hi,
>
> can you please enable qx.debug.io [1] and report the URL that is being
> requested?
>
> Thanks!
>
> Tristan
>
> [1]
> http://manual.qooxdoo.org/1.6.x/pages/communication/request_io.html#debugging
>
> Am 17.01.2012 um 22:19 schrieb aditya siram:
>
> > Hi all,
> > I am having an issue with IE seemingly caching the results of a GET request
> > made using qx.io.rest.Resource with the default qx.io.rest.Xhr request.
> >
> > I have a list of items and when I select an item the server is queried and
> > and it's associated data is displayed in an editable form. If the form is
> > edited and submitted the new data is written to a server-side database. The
> > next time this item is selected the new information should be displayed.
> >
> > Currently in Firefox and Chrome this works as expected: the user selects
> > item A, changes some things, submits, selects item B, reselects A and sees
> > the new information.
> >
> > In IE, when the user reselects item A the old information is displayed.
> >
> > In order to eliminate request caching I have a "req.setCache(false)" in the
> > "configureCallback" function for each of these queries. Using the IE
> > debugger I have confirmed that this function is being called before every
> > query. I have also tried "req.setCache("no-store") and
> > "req.setCache("no-cache") with the same results.
> >
> > I am going to research this some more, but I was hoping someone may have
> > run into this before.
> >
> > Thanks ...
> > -deech
> > ------------------------------------------------------------------------------
> > Keep Your Developer Skills Current with LearnDevNow!
> > The most comprehensive online learning library for Microsoft developers
> > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> > Metro Style Apps, more. Free future releases when you subscribe now!
> > http://p.sf.net/sfu/learndevnow-d2d_______________________________________________
> > qooxdoo-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d_______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel