tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger Parkinson <>
Subject Re: serving files through SSL
Date Thu, 08 Nov 2007 19:41:53 GMT
1) response.setContentLength(10115);
Yep, hard coded value figured by checking the length of my test pdf file 
manually. I believe it is correct. I don't want to add the code that 
would figure the length unless I have some evidence that it makes any 
difference and it hasn't yet.
2) I changed the ETag to add the extra quote but that made no 
difference. I believe that the ETag is just a semi-random string ('semi' 
meaning it is the same value for the same file but otherwise randomly 
generated). So the actual content should make no difference.

I'm still looking for the difference between the response for the static 
file and the response for the dynamic file. I've identified that the 
cache headers are being set by default on the dynamic file. Is there a 
way to turn these off? I don't know that they are the issue but it is 
the one difference I can spot.


Gabe Wong wrote:
> Roger Parkinson wrote:
>> I'm opening the PDF in a new window (as the javascript shows) so what 
>> I see for the dynamic pdf is:
>> 1) the new window (empty)
>> 2) the download progress dialog
>> 3) an error dialog referring the file name with the message 'cannot 
>> write the file to the cache'
>> On the static PDF I don't see 2 or 3 and the new window has the PDF 
>> displayed.
>> (I' using the terms dynamic and static as referred to in my initial 
>> question, ie static is the PDF in the war file that always works and 
>> dynamic is the one fetched from outside the war file by a servlet and 
>> this is the one with the problem).
>> I did search on that cache message and all the solutions told me to 
>> either upgrade my browser from 5.5 (I'm using 6), change the browser 
>> config, or set the cache headers that seem to be already set. It was 
>> when I realised that the static PDF was always just fine that I 
>> concluded that the problem did not need to be solved at the browser end.
> 1)        response.setContentLength(10115);
> Is 10115 a hard coded number or just there as an illustration. If it 
> is hard coded then the content length should be set to the
> correct value.
> 2)       response.addHeader("ETag","W/\"963288-1194247031062");
> Perhaps the missing \" at the end could be a problem?

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message