PassMark Logo
Home » Forum


No announcement yet.

Compressed XML Request

  • Filter
  • Time
  • Show
Clear All
new posts

  • Compressed XML Request


    We use the 'zoom_xml=1' parameter to create an AJAX query that returns similar pages for any given URL.

    The Request Headers have the 'Accept-Encoding: gzip, deflate' sent with them, but the response is not being compressed when returned.

    I've attempted all sort of lines in our .htaccess file to force compression on file types, but nothing is working.

    Our regular /search.cgi page is compressed when returned, it's only when we add the 'zoom_xml=1' parameter in that it no longer gets compressed.

    How can I have the the XML response compressed when returned?

  • #2
    Don't know the answer. At least not without doing some research into the matter. HTTP compression is done by the web server (e.g. Apache or IIS or whatever you are using) and not the script. So it should be some configuration setting in your server. You can modify the HTTP header via scripting, so maybe the script is changing some header in some way that the web server doesn't like.

    We don't support V6 anymore in any case (not that I think V7 will change this behaviour)


    • #3
      Even excluding the script we use to generate the content, when visiting the '/search.cgi?zoom_xml=1' URL directly in a browser there is no GZIP compression.

      When visiting a normal search URL (without the xml parameter), the Response Header includes 'Content-Encoding: gzip'.

      So something else must be happening when the xml type is requested that causes the Content-Encoding header to not be included.

      I'm curious if you have the ability to test the xml parameter on another live zoom search engine enabled server to see if it is server specific.

      Is that possible?


      • #4
        I ran small test on a custom xml file, and found that if I changed the Content Type of the file to 'application/xml' (instead of 'text/xml') the request was sent through with gzip compression.

        So I'll need to look at a way of changing the Content-Type of the XML file - perhaps through .htaccess - but I don't want to change the Content-Type of the regular search.

        It's strange that the compression doesn't work with the Content Type 'text/xml'.


        • #5
          It should be possible to setup your server to compress these doc types (at least in theory, I haven't actually tried it myself)


          • #6
            Yes it seems as though it's something to do with the 'text/xml' Content Type not being recognised as a compressible MIME type. I think I can add it via .htaccess - or I might have to do it through the server back-end.

            Thanks for your support.