Closed
Bug 522463
Opened 15 years ago
Closed 7 years ago
XHR with If-Modified-Since header isn't cached, fails to invalidate cache entry for previous request
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 482934
Tracking | Status | |
---|---|---|
blocking2.0 | --- | - |
People
(Reporter: jsmilam, Unassigned)
References
Details
Attachments
(3 files)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2b1pre) Gecko/20091014 Namoroka/3.6b1pre (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2b1pre) Gecko/20091014 Namoroka/3.6b1pre (.NET CLR 3.5.30729)
A XMLHttpRequest for a given URL (for instance '/resource') with a response header of "Cache-Control: max-age=300" is cached in the disk cache as expected. A second XHR is made with an "If-Modified-Since: Wed Dec 31 1969 19:00:00 GMT-0500 (EST)" header. The response to the second request comes back with fresh data, but it is not cached in the disk cache even though a "Cache-Control: max-age=300" header is present. This would be acceptable except when a third request is made for the same URL it returns a stale response from the first XHR made as long as the 300 second max-age has not expired.
Reproducible: Always
Steps to Reproduce:
1. Make a XHR to a URL which will respond with a Cache-Control: max-age=300 header to a URL which will return different results on each request
2. Make a XHR with a Request header of "If-Modified-Since: Wed Dec 31 1969 19:00:00 GMT-0500 (EST)" and a response header of "Cache-Control: max-age=300"
3. Make a XHR matching the first request
Actual Results:
Responses from the 1st and 3rd XHR are the same because the 3rd request is served from cache. The 2nd request is different from the 1st and second.
Expected Results:
I would expect that the 3rd request match the 2nd request. Or that all requests have unique responses.
Comment 1•15 years ago
|
||
Comment 2•15 years ago
|
||
Comment 3•15 years ago
|
||
The tests are now online:
http://getfirebug.com/tests/issues/bugzilla/b522463/b522463-XHR-cache-fails.html
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 4•15 years ago
|
||
Honza, could you take a look at this and double check the cache headers? I plan to ask for blocking here since this is a subtle bug that could make lots of XHR sites fail in ways that would be hard to sort out.
To resummarize: the 3rd GET response comes from the cache of the 1st GET response.
Comment 5•15 years ago
|
||
Dupe of bug 475156?
Comment 6•15 years ago
|
||
I ran the test case from comment 3 on
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a1pre) Gecko/20091021 Minefield/3.7a1pre
It still fails.
Comment 7•15 years ago
|
||
(In reply to comment #6)
> I ran the test case from comment 3 on
> Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a1pre) Gecko/20091021
> Minefield/3.7a1pre
> It still fails.
Are you sure the build already contained the fix? It has been landed the same day.
Comment 8•15 years ago
|
||
For me this is fixed.
Updated•15 years ago
|
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 9•15 years ago
|
||
Correctly this is duplicate of bug 475156.
Depends on: 475156
Resolution: FIXED → DUPLICATE
Reporter | ||
Comment 10•15 years ago
|
||
I think the test case only passes now because the test case is faulty. The behaviour on 3.6 was the third request returned the cached response of the first request, while the second request (containing the If-Modified-Since header) returned a fresh response. It seems that on the 3.7 build, where the test is passing, that both the second and third requests return cached responses of the first. I also tried refreshing the browser cache using Cache-Control directives, min-age, min-fresh, no-cache, and max-age. None of them force the cache to be refreshed.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Reporter | ||
Comment 11•15 years ago
|
||
Changing line 36 of b522463/b522463-XHR-cache-fails.html from
if( time1 == time3 && time2 != time3 ){
to
if( (time1 == time3 && time2 != time3) || (time1 == time2 && time1 == time3) ){
would be a more correct test case.
Comment 12•15 years ago
|
||
-> me
will take a look at this.
Assignee: nobody → honzab.moz
Status: REOPENED → ASSIGNED
blocking2.0: --- → ?
Comment 13•15 years ago
|
||
Did this get lost?
Comment 14•15 years ago
|
||
No, just dropped lower in my todo list. It has not been approved as blocking so far.
Comment 16•13 years ago
|
||
Releasing for now. Anyone feel free to take it or let me know this is still a priority and I can take it back.
Assignee: honzab.moz → nobody
Updated•13 years ago
|
Status: ASSIGNED → NEW
Updated•13 years ago
|
Component: General → DOM: Mozilla Extensions
Product: Firefox → Core
QA Contact: general → general
Version: 3.6 Branch → 1.9.2 Branch
Assignee | ||
Updated•12 years ago
|
Component: DOM: Mozilla Extensions → DOM
Comment 18•7 years ago
|
||
honza, is this still an issue? The test in the URL in comment 3 is passing for me, even if I use a proxy to alter its script to have the fix suggested in comment 11. Did bug 482934 perhaps end up fixing it as believed?
Flags: needinfo?(honzab.moz)
Comment 19•7 years ago
|
||
I think we can duplicated this to bug 482934.
Status: NEW → RESOLVED
Closed: 15 years ago → 7 years ago
Flags: needinfo?(honzab.moz)
Resolution: --- → DUPLICATE
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•