0

I am trying to enable apache to gzip responses. I am on Windows 7, using Apache 2.2. I have my own module mod_myModule.so that is serving requests comming from device (.NETCF3.5 client) and sending back SOAP response to the client.

I did following, all in my httpd.conf file: 1. uncommented this line

LoadModule deflate_module modules/mod_deflate.so
  1. this already existed in httpd.conf so did not change anything but I did try to uncomment DeflateCompressionLevel 9 but if uncommented, I was not able to start Apache:

    # Insert filter SetOutputFilter DEFLATE

    # compress text, html, javascript, css, xml:
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/json
    AddOutputFilterByType DEFLATE application/x-javascript
    
    #DeflateCompressionLevel 9  //UNCOMMENTING THIS WONT ALLOW APACHE TO START
    # 1 to 9: 9 is the most compressed
    
    # Netscape 4.x has some problems...
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    
    # Netscape 4.06-4.08 have some more problems
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    
    # MSIE masquerades as Netscape, but it is fine
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    
    # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
    # the above regex won't work. You can use the following
    # workaround to get the desired effect:
    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    
    #The following statement indicate which document types not to compress. Many type of documents do not compress well.
    #At the end (Appendix 1) of this article some more type you might wish to also exclude from compression
    # Don't compress images
    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
    
    # Make sure proxies don't deliver the wrong content
    # install/enable the Apache module mod_headers
    Header append Vary User-Agent env=!dont-vary
    
    # install/enable the Apache module LoadModule expires_module modules/mod_expires.so
    # turn on the module for this directory
    ExpiresActive on
    
    # set defaults
    ExpiresByType text/javascript "modification plus 11 months"
    ExpiresByType application/javascript "modification plus 11 months"
    ExpiresByType text/css "modification plus 11 months"
    

However, my HttpWebResponse.ContextEncoding is "" rather than "gzip" as I understand it should be.

What I am missing?

Thank you,

pixel
  • 9,653
  • 16
  • 82
  • 149

0 Answers0