Closed Bug 286082 Opened 20 years ago Closed 1 years ago

PDF file with Cache-Control / Expires header not being cached due to Range header

Categories

(Core :: Networking: Cache, defect, P3)

x86
Windows XP
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: pellentesque, Unassigned)

References

()

Details

(Keywords: regression, Whiteboard: [necko-backlog])

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050313 Firefox/1.0+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050313 Firefox/1.0+ The PDF file http://www.britishcitizen.info/StatelessReductionProvisions.pdf is served with a Cache-Control HTTP header and an Expires HTTP header that instructs the browser (or caching proxy) to store the file for 30 days (see headers below): %curl -I http://www.britishcitizen.info/StatelessReductionProvisions.pdf HTTP/1.1 200 OK Date: Mon, 14 Mar 2005 11:27:07 GMT Server: Apache/1.3.29 Cache-Control: max-age=2592000 Expires: Wed, 13 Apr 2005 11:27:07 GMT Last-Modified: Mon, 14 Mar 2005 09:16:18 GMT ETag: "289937-bb9a-42355662" Accept-Ranges: bytes Content-Length: 48026 Content-Type: application/pdf However, Firefox does not appear to be caching this PDF at all. When loaded, if you click back and then click the link to it again, it will re-download the PDF. After going into about:cache?device=disk and looking for the entry, I found that there wasn't one. I tried to reproduce this bug with a new profile, and found the same behaviour: it wasn't being cached and there was no entry for the PDF in about:cache Internet Explorer 6 appears to be caching the file correctly. After checking its cache properties, it correctly set the expiry date to 30 days from initial download, and loads the file from cache every time without a new download. On the same server there is a GIF image at http://www.britishcitizen.info/somerights20.gif which is served with similar Cache-Control / Expires headers. Firefox seems to handle this one perfectly well. If it makes a difference, I'm using Adobe Reader 7.0.0. Reproducible: Always Steps to Reproduce: See above Actual Results: It doesn't cache the PDF Expected Results: It should cache the PDF
I've been able to verify the same behaviour as the reporter on both Firefox and Seamonkey builds from 20050313. I also tried Seamonkey 1.8b1, where the file was cached correctly, so I'm marking this as a regression. But at the same time, there was a difference between how 1.8b1 handled it the file and how trunk Firefox and Seamonkey handle it now. 1.8b1 prompted me to open or save the file, whereas recent trunk builds just used the Adobe plugin to display the PDF in the browser. I'm not sure why the change, because both Seamonkey builds were using the same profile. Maybe this is responsible for the change in caching behaviour. In any case, I think the current behaviour is wrong, as the file should clearly be cached according to the HTTP headers (IE does it fine and does not redownload the file over and over, even when using the Adobe plugin). I'm leaving this as unconfirmed for now so that someone else who knows more about this than I do can make the call, and also moving the bug over to Core since it affects both Firefox and Seamonkey.
Assignee: bugs → file-handling
Keywords: regression
Product: Firefox → Core
QA Contact: aebrahim-bmo → ian
Moving to Networking: Cache (where I wanted it in the first place, but Bugzilla was trying to be too smart).
Assignee: file-handling → darin
Component: File Handling → Networking: Cache
QA Contact: ian → networking.cache
After clearing the cache, I created an HTTP log of the following steps: 1. Load http://www.britishcitizen.info/ 2. Click link to http://www.britishcitizen.info/StatelessReductionProvisions.pdf (It loads in the Adobe Reader plugin). 3. Press Back. 4. Click link to http://www.britishcitizen.info/StatelessReductionProvisions.pdf (It loads in the Adobe Reader plugin, but redownloads instead of loading from cache, where it appears not to have been saved).
OK... From the log... 0[274540]: nsHttpChannel::SetRequestHeader [this=1fad6f8 header="Range" value="bytes=6942-48025,6942-6943" merge=0] (via http://lxr.mozilla.org/seamonkey/source/modules/plugin/base/src/nsPluginHostImpl.cpp#1435 I presume. maybe someone should verify that with a debugger or printf) http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHttpChannel.cpp#1177 1178 // we don't support caching for byte range requests initiated 1179 // by our clients or via nsIResumableChannel. so I assume that's what causing this to not use the cache.
This is an automated message, with ID "auto-resolve01". This bug has had no comments for a long time. Statistically, we have found that bug reports that have not been confirmed by a second user after three months are highly unlikely to be the source of a fix to the code. While your input is very important to us, our resources are limited and so we are asking for your help in focussing our efforts. If you can still reproduce this problem in the latest version of the product (see below for how to obtain a copy) or, for feature requests, if it's not present in the latest version and you still believe we should implement it, please visit the URL of this bug (given at the top of this mail) and add a comment to that effect, giving more reproduction information if you have it. If it is not a problem any longer, you need take no action. If this bug is not changed in any way in the next two weeks, it will be automatically resolved. Thank you for your help in this matter. The latest beta releases can be obtained from: Firefox: http://www.mozilla.org/projects/firefox/ Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html Seamonkey: http://www.mozilla.org/projects/seamonkey/
The problem here is that the Adobe PDF plugin is making byte range requests. Our cache does not know how to serve byte range requests, so the requests end up going out over the network. Here's the tell-tail snipet from the HTTP log file: 0[274540]: nsHttpChannel::SetRequestHeader [this=1fad6f8 header="Range" value="bytes=6942-48025,6942-6943" merge=0] Confirming bug.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: PDF file with Cache-Control / Expires header not being cached → PDF file with Cache-Control / Expires header not being cached due to Range header
Target Milestone: --- → Future
-> default owner
Assignee: darin → nobody
Target Milestone: Future → ---
Whiteboard: [necko-backlog]
This bug has been tagged for Regression and or Closure. We have had changes to functionality for PDF "Reader View" Is this still an issue? If yes please provide updated link to the PDF/Fx Version/OS. Tested PDF functionality in latest release Version 46.0.1 Build ID 20160502172042 User Agent Mozilla/5.0 (Windows NT 5.1; rv:46.0) Gecko/20100101 Firefox/46.0
Flags: needinfo?(pellentesque)
Closing as Incomplete: Feel free to reopen the bug if the issue still reproduces on a current build. Please provide detailed Steps, Operating System and Firefox version.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
michelle - what basis do you have to think this is fixed? if you'd like to test with the reader and see if it still issues range requests that would be a contribution to the bug..
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Our triage instructions were to close if there is no response after 2 weeks vs a month, as it can be reopened if needed. Testing under Comment 10 I saw no issues Tested: The links in this bug have had changes but there in info that I can work with; Also tested: http://www.dbsparks.com/research/html/SNRN02.pdf I do see info in about:cache for these sites Version 47.0 Build ID 20160604131506 User Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
Priority: -- → P1
Priority: P1 → P3
Severity: normal → S3
Status: REOPENED → NEW

A needinfo is requested from the reporter, however, the reporter is inactive on Bugzilla. Closing the bug as incomplete.

For more information, please visit BugBot documentation.

Status: NEW → RESOLVED
Closed: 8 years ago1 years ago
Flags: needinfo?(pellentesque)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: