Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I need to prevent pdf objects from being gzipped. Really, this only needs to take place if the request is from the Mozilla browser (but since I can't get something as seemingly simple as no-gzip for application/pdf, I figure it's wiser to start there). From looking at the apache documentation on mod_filter, I've got the following:

<Location />
  FilterDeclare gzipDeflate CONTENT_SET
  FilterDeclare gzipInflate CONTENT_SET
  FilterProvider gzipDeflate deflate req=User-Agent $Mozilla/
  FilterProvider gzipInflate inflate resp=Content-Type $application/
  FilterChain +gzipDeflate +gzipInflate
</Location>

From my testing, the gzipDeflate filter is doing its job and all the pages without the Content-Type starting with application are being gzipped. But, the gzipInflate doesn't seem to be working at all. I've inspected the response in Firebug and verified that the Content-Type being sent down is application/pdf. I'll go ahead and ask a potentially stupid question though:

The response's Content-Type header in its entirety read "application/pdf; charset=Windows-1252". Does that make any sort of difference or is $application/ presumably enough to catch that?

Any help is greatly appreciated.

One other point, the URL that returns the pdf object does not have the .pdf extension. The pdf itself is stored in an Oracle database as a blob and appended to the page when appropriate (all the urls in the system use the same baseline). This was part of an original inquiry by a helpful member at stackoverflow who pointed me towards mod_filter and suggested I post the question here.

share|improve this question
    
Could you explain a bit more what exactly is going on? Or is there documentation that you followed? –  isaaclw Nov 5 '12 at 22:59

1 Answer 1

up vote 1 down vote accepted

It turns out there wasn't anything wrong with what I had. The very 1st line within the location tag was:

SetOutputFilter DEFLATE

After removing that, everything worked correctly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.