The only thing I can see wrong here is the
'Expires:' value.
Could be worth removing this header, or giving it a
sane value.
Also, it would be nice to set the name of the
server.
Maybe there are some set-up parameters needed by
your filter to control these two headers?
----- Original Message -----
Sent: Friday, April 01, 2005 10:49
AM
Subject: RE: [Jetty-support] Compression
Filter Problem
Thanks for the responses!
These are the headers for the jsp request
HTTP/1.1 200 OK
Date: Fri, 01 Apr 2005 09:33:35 GMT
Server:
Unknown
Content-Encoding: gzip
Transfer-Encoding: chunked
Expires:
Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache
Pragma:
no-cache
Content-Type: text/html; charset=UTF-8
Set-Cookie:
JSESSIONID=508tf9876kob5;path=/test
and
these for the pdf
HTTP/1.1 200 OK
Date: Fri, 01 Apr 2005 09:44:13 GMT
Server:
Unknown
Content-Encoding: gzip
Transfer-Encoding: chunked
Expires:
Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache
Pragma:
no-cache
Content-Type: application/pdf
Last-Modified: Wed, 01 Dec 2004
14:58:12 GMT
Accept-Ranges: bytes
It
may well be a header issue, but as I said, I get the same problem with an off
the shelf compression filter, which wouldn't particularly indicate a bug in my
own filter.
I'm
not setting the Content-Disposition header because I don't want the open/save
dialog to appear; I want the pdf to open in the browser (MSIE 6.0 SP1)
as it does when the content is not compressed.
Thanks again
Nick
Er, actually, on second thoughts I now think
compression _should_ work with PDF. Sorry.
Your problems are almost certainly to do with
headers.
You should be including a Content-Encoding
header, such as
Content-Encoding:
gzip
or
Content-Encoding:
compress
If you are still having trouble, post the
headers here so we can look at them, and tell us which compression algorithm
you are using.
Chris Haynes
----- Original Message -----
Sent: Friday, April 01, 2005 10:15
AM
Subject: Re: [Jetty-support]
Compression Filter Problem
Don't even try to compress PDF downloads. The
MSIE/ADOBE combination relies on multiple, direct byte-indexed access to
the 'file'. See several archived posts concerning PDF and
MSIE.
As for .jsp, well, its up to the JSP class
what kind of response it generates. Normally it is HTML and so, with the
matching content-related headers in the response, I don't know why it
should not work. Check what headers are being generated. But are
your responses from JSP queries really that large that you need
compression?
Chris Haynes
----- Original Message -----
Sent: Friday, April 01, 2005 9:21
AM
Subject: [Jetty-support]
Compression Filter Problem
Hi all
I'm running Jetty 4.2.11 and JBoss 3.2.2 and have written a
filter to compress the response for certain Mime Types. All seems
to work well for .html files, but I run into problems with .pdf and .jsp
files.
With .pdf files, I get the save/open file dialog, rather than
having the pdf open in the browser. Regardless of whether I select
open or save, I then get a message that IE is not able to access the
site.
With JSPs, I just get a blank page.
I thought this may be a problem with my filter, but having
downloaded a free one from the web, I get the same
problems.
Spoofing the request, seems to return the correct headers and the
correct content length.
I've also tried this with Jetty 5 and get the same
thing.
Does anyone have any idea why this may be happening or can
suggest some free software that they know works.
Many thanks
Nick
Set yourself a
tennis challenge!
Enter this year's
Nomura Inter-Company Tennis Challenge
Entries close 15
April 2005
www.nomura-tennis.co.uk
PLEASE READ: The
information contained in this email is confidential
and intended for
the named recipient(s) only. If you are not an intended
recipient of this
email you must not copy, distribute or take any
further action in
reliance on it and you should delete it and notify the
sender
immediately. Email is not a secure method of communication and
Nomura
International plc cannot accept responsibility for the
accuracy
or completeness of
this message or any attachment(s). Please examine this
email for virus
infection, for which Nomura International plc accepts
no responsibility.
If verification of this email is sought then please
request a hard
copy. Unless otherwise stated any views or opinions
presented are
solely those of the author and do not represent those of
Nomura
International plc. This email is intended for
informational
purposes only and
is not a solicitation or offer to buy or sell
securities or
related financial instruments. Nomura International plc is
regulated by the
Financial Services Authority and is a member of the
London Stock
Exchange.