Forum Discussion

Tom_63996's avatar
Tom_63996
Icon for Nimbostratus rankNimbostratus
Jul 10, 2014

Compression when request has a query string?

I am configuring F5 LTM 11.5 with compression and cache to optimise delivery as we look to go live.

 

With compression, enabled with default values initially, there is no problem if the request is a straight XYZ.js.

 

The instant we add a version query string to it, so XYZ.js?version=A.B.C, it doesn't compress. Can anyone please shed some light on where i've gone wrong and what I need to do in order to get this working? It's fine with either the Netscaler we have now, or the A10 we just trialled.

 

Many thanks!

 

9 Replies

  • I've removed the content section, so just URI, which is default at .*

     

  • Can you post the profile CLI configuration output please? I always use Content Type which keeps things fairly simple.

     

  • I've changed it round to be content-type, as that makes more sense I think.

    The config is this:

    ltm profile http-compression V2QA_DefaultCompression {

    app-service none
    buffer-size 1048576
    content-type-exclude none
    content-type-include { text/* application/javascript application/x-javascript application/* }
    defaults-from wan-optimized-compression
    gzip-level 6
    uri-exclude none
    uri-include none
    

    }

    I see it compressing CSS, which we also feed a query string, but still not the JS files.

    Many thanks for your help!

  • Hmmm. Looks OK.

     

    Can you do a quick tpcdump (or use HTTPHeaders or something similar at the browser end) to see if the responses that are not compressed have a Content-Type header?

     

    If they don't you may need to switch back to URI and add * to the end of the URI types (.js rather than *.js).

     

  • Headers look OK to me - this is from Fiddler, response headers:

     

    HTTP/1.1 200 OK Content-Type: application/javascript Last-Modified: Fri, 04 Jul 2014 12:42:24 GMT Accept-Ranges: bytes ETag: "dfdb99678597cf1:0" Date: Thu, 10 Jul 2014 15:38:41 GMT Transfer-Encoding: chunked

     

  • Accept encoding headers also there in the request?

     

    Also, do you have Chunking: Selective in the HTTP profile.

     

    Sorry, things keep coming to mind as we go.

     

  • it wasn't, but it is now with no change on compression.

     

    request header is :

     

    Accept-Encoding: gzip,deflate,sdch

     

  • Odd. Is it because the .js files are tiny perhaps?

     

    Again, have you tried switching back to URI and using .jpg?