I've got the strangest XMLHTTPRequest problem, and it occurs in both IE6 and FF3! I'm sending an XMLHTTP POST request to the server to update some data. The problem is that the response I'm getting back appears to be a cached response, sort of (I'll explain that in a minute). I've tried every method I could think of to prevent caching responses (using POST, cache control headers, content expiration headers, etc.) but nothing works. Even clearing the temporary files cache in IE6 doesn't work. The only thing that appears to work is closing the browser. Then I'll get ONE current response, but the problem starts all over again.
The symptoms are strange too, it's not like the 2nd and subsequent requests aren't sent to the server, they are, and I actually get responses back, just not when they should (they show up later). In order to try to diagnose the problem, I inserted the current time into both the request and the server response. Here is a list of the responses I got back on repeated requests. Sorry it's so long, but it's necessary to see the pattern. I've also numbered the lines and color-coded the first few to make things easier to follow:
1 [highlight #FB8985]47:10[/highlight] (this one is right on time)
2 [highlight #FB8985]47:10[/highlight]
3 [highlight #FBD085]47:19[/highlight]
4 [highlight #FB8985]47:10[/highlight]
5 [highlight #EAFA86]47:26[/highlight]
6 [highlight #FBD085]47:19[/highlight]
7 [highlight #A4FB85]47:34[/highlight]
8 [highlight #FB8985]47:10[/highlight]
9 [highlight #85FBCE]47:42[/highlight]
10 [highlight #EAFA86]47:26[/highlight]
11 [highlight #85D0FB]47:49[/highlight]
12 [highlight #FBD085]47:19[/highlight]
13 [highlight #858DFB]47:57[/highlight]
14 [highlight #A4FB85]47:34[/highlight]
15 [highlight #ffffff]48:05[/highlight]
16 [highlight #FB8985]47:10[/highlight]
17 [highlight #ffffff]48:12[/highlight]
18 [highlight #85FBCE]47:42[/highlight]
19 [highlight #ffffff]48:21[/highlight]
20 [highlight #EAFA86]47:26[/highlight]
21 [highlight #ffffff]48:28[/highlight]
22 [highlight #85D0FB]47:49[/highlight]
23 [highlight #ffffff]48:36[/highlight]
24 [highlight #FBD085]47:19[/highlight]
25 [highlight #ffffff]48:43[/highlight]
26 [highlight #858DFB]47:57[/highlight]
27 [highlight #ffffff]48:52[/highlight]
28 [highlight #A4FB85]47:34[/highlight]
29 [highlight #ffffff]48:59[/highlight]
30 [highlight #ffffff]48:05[/highlight]
31 [highlight #ffffff]49:10[/highlight]
32 [highlight #FB8985]47:10[/highlight]
33 [highlight #ffffff]49:17[/highlight]
34 [highlight #ffffff]48:12[/highlight]
35 [highlight #ffffff]49:25[/highlight]
36 [highlight #85FBCE]47:42[/highlight]
37 [highlight #ffffff]49:33[/highlight]
38 [highlight #ffffff]48:21[/highlight]
39 [highlight #ffffff]49:41[/highlight]
40 [highlight #EAFA86]47:26[/highlight]
41 [highlight #ffffff]49:51[/highlight]
42 [highlight #ffffff]48:28[/highlight]
43 [highlight #ffffff]49:59[/highlight]
44 [highlight #85D0FB]47:49[/highlight]
45 [highlight #ffffff]50:08[/highlight]
46 [highlight #ffffff]48:36[/highlight]
47 [highlight #ffffff]50:16[/highlight]
48 [highlight #FBD085]47:19[/highlight]
49 [highlight #ffffff]50:25[/highlight]
50 [highlight #ffffff]48:43[/highlight]
51 [highlight #ffffff]50:35[/highlight]
52 [highlight #858DFB]47:57[/highlight]
53 [highlight #ffffff]50:43[/highlight]
54 [highlight #ffffff]48:52[/highlight]
55 [highlight #ffffff]50:52[/highlight]
56 [highlight #A4FB85]47:34[/highlight]
57 [highlight #ffffff]50:59[/highlight]
58 [highlight #ffffff]48:59[/highlight]
59 [highlight #ffffff]51:24[/highlight]
60 [highlight #ffffff]48:05[/highlight]
61 [highlight #ffffff]51:35[/highlight]
62 [highlight #ffffff]49:10[/highlight]
63 [highlight #ffffff]51:42[/highlight]
64 [highlight #FB8985]47:10[/highlight]
65 [highlight #ffffff]51:50[/highlight]
66 [highlight #ffffff]49:17[/highlight]
67 [highlight #ffffff]52:00[/highlight]
68 [highlight #ffffff]48:12[/highlight]
69 [highlight #ffffff]52:07[/highlight]
70 [highlight #ffffff]49:25[/highlight]
71 [highlight #ffffff]52:15[/highlight]
72 [highlight #85FBCE]47:42[/highlight]
73 [highlight #ffffff]52:23[/highlight] (got this one at 57:23!)
Notice that the first response was also the 2, 4th, 8th, 16th, 32nd and 64th. The "second" response showed as the 3rd, 6th, 12th, 24th and 48th. The "third" response showed as the 5th, 10th, 20th and 40th. This pattern repeats reliably. Also notice that every other response is one that has not been seen before.
So, what would give me this kind of a strange pattern in returning responses that should not be cached in the first place? Also, if it were actually a caching issue, shouldn't ALL the responses be the same? It looks like every request is actually getting sent to the server and received back again, but they're not being returned sequentially.
Any ideas would be GREATLY appreciated! This has been driving me nuts for two days now!
Tracy Dryden
Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
The symptoms are strange too, it's not like the 2nd and subsequent requests aren't sent to the server, they are, and I actually get responses back, just not when they should (they show up later). In order to try to diagnose the problem, I inserted the current time into both the request and the server response. Here is a list of the responses I got back on repeated requests. Sorry it's so long, but it's necessary to see the pattern. I've also numbered the lines and color-coded the first few to make things easier to follow:
1 [highlight #FB8985]47:10[/highlight] (this one is right on time)
2 [highlight #FB8985]47:10[/highlight]
3 [highlight #FBD085]47:19[/highlight]
4 [highlight #FB8985]47:10[/highlight]
5 [highlight #EAFA86]47:26[/highlight]
6 [highlight #FBD085]47:19[/highlight]
7 [highlight #A4FB85]47:34[/highlight]
8 [highlight #FB8985]47:10[/highlight]
9 [highlight #85FBCE]47:42[/highlight]
10 [highlight #EAFA86]47:26[/highlight]
11 [highlight #85D0FB]47:49[/highlight]
12 [highlight #FBD085]47:19[/highlight]
13 [highlight #858DFB]47:57[/highlight]
14 [highlight #A4FB85]47:34[/highlight]
15 [highlight #ffffff]48:05[/highlight]
16 [highlight #FB8985]47:10[/highlight]
17 [highlight #ffffff]48:12[/highlight]
18 [highlight #85FBCE]47:42[/highlight]
19 [highlight #ffffff]48:21[/highlight]
20 [highlight #EAFA86]47:26[/highlight]
21 [highlight #ffffff]48:28[/highlight]
22 [highlight #85D0FB]47:49[/highlight]
23 [highlight #ffffff]48:36[/highlight]
24 [highlight #FBD085]47:19[/highlight]
25 [highlight #ffffff]48:43[/highlight]
26 [highlight #858DFB]47:57[/highlight]
27 [highlight #ffffff]48:52[/highlight]
28 [highlight #A4FB85]47:34[/highlight]
29 [highlight #ffffff]48:59[/highlight]
30 [highlight #ffffff]48:05[/highlight]
31 [highlight #ffffff]49:10[/highlight]
32 [highlight #FB8985]47:10[/highlight]
33 [highlight #ffffff]49:17[/highlight]
34 [highlight #ffffff]48:12[/highlight]
35 [highlight #ffffff]49:25[/highlight]
36 [highlight #85FBCE]47:42[/highlight]
37 [highlight #ffffff]49:33[/highlight]
38 [highlight #ffffff]48:21[/highlight]
39 [highlight #ffffff]49:41[/highlight]
40 [highlight #EAFA86]47:26[/highlight]
41 [highlight #ffffff]49:51[/highlight]
42 [highlight #ffffff]48:28[/highlight]
43 [highlight #ffffff]49:59[/highlight]
44 [highlight #85D0FB]47:49[/highlight]
45 [highlight #ffffff]50:08[/highlight]
46 [highlight #ffffff]48:36[/highlight]
47 [highlight #ffffff]50:16[/highlight]
48 [highlight #FBD085]47:19[/highlight]
49 [highlight #ffffff]50:25[/highlight]
50 [highlight #ffffff]48:43[/highlight]
51 [highlight #ffffff]50:35[/highlight]
52 [highlight #858DFB]47:57[/highlight]
53 [highlight #ffffff]50:43[/highlight]
54 [highlight #ffffff]48:52[/highlight]
55 [highlight #ffffff]50:52[/highlight]
56 [highlight #A4FB85]47:34[/highlight]
57 [highlight #ffffff]50:59[/highlight]
58 [highlight #ffffff]48:59[/highlight]
59 [highlight #ffffff]51:24[/highlight]
60 [highlight #ffffff]48:05[/highlight]
61 [highlight #ffffff]51:35[/highlight]
62 [highlight #ffffff]49:10[/highlight]
63 [highlight #ffffff]51:42[/highlight]
64 [highlight #FB8985]47:10[/highlight]
65 [highlight #ffffff]51:50[/highlight]
66 [highlight #ffffff]49:17[/highlight]
67 [highlight #ffffff]52:00[/highlight]
68 [highlight #ffffff]48:12[/highlight]
69 [highlight #ffffff]52:07[/highlight]
70 [highlight #ffffff]49:25[/highlight]
71 [highlight #ffffff]52:15[/highlight]
72 [highlight #85FBCE]47:42[/highlight]
73 [highlight #ffffff]52:23[/highlight] (got this one at 57:23!)
Notice that the first response was also the 2, 4th, 8th, 16th, 32nd and 64th. The "second" response showed as the 3rd, 6th, 12th, 24th and 48th. The "third" response showed as the 5th, 10th, 20th and 40th. This pattern repeats reliably. Also notice that every other response is one that has not been seen before.
So, what would give me this kind of a strange pattern in returning responses that should not be cached in the first place? Also, if it were actually a caching issue, shouldn't ALL the responses be the same? It looks like every request is actually getting sent to the server and received back again, but they're not being returned sequentially.
Any ideas would be GREATLY appreciated! This has been driving me nuts for two days now!
Tracy Dryden
Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.