Is the server sending compressed response payloads? If so, LTM won’t decompress it before applying the stream profile. You could check the responses using a browser plugin like HttpFox for Firefox or Fiddler2. If you want to prevent server response payload compression, you can use a simple iRule:
when HTTP_REQUEST {
HTTP:header remove "Accept-Encoding"
}
You could also use an iRule to configure the stream filter and only apply it to text responses. By default, when you use a stream profile and HTTP profile, both request and response payloads will have the stream filter applied. For examples of an iRule, you can check the STREAM::expression wiki page:
As you told, stream is applied *before* the decompression. But on iRules will I got the payload uncompressed?
If so I can let the compress working as is, and do the irule.
Something like: (shamelessly coppied from devcentral wiki üòâ
when HTTP_REQUEST {
Disable the stream filter for all requests
STREAM::disable
}
when HTTP_RESPONSE {
Check if response type is text
if {[HTTP::header value Content-Type] contains "text"}{
Remove Body onload attribute
STREAM::expression "@onload=\"onLoadBody()\"@@"
Enable the stream filter for this response only
STREAM::enable
}
}
That looks good to me. You could avoid the backslash escapes by using curly braces to prevent interpretation:
STREAM::expression {@onload=“onLoadBody()”@@}
Also, I’m referring to server response payload. LTM compression should be done to responses after the stream filter is applied (though I haven’t explicitly tested this before).
Nice. It worked, but I have noticed that my problem was the Accept Encoding.
I understood that stream happens BEFORE deflating. But removing the Accept-encoding header didnt I lose the compression client site? If so how can I get the best of two worlds?
Being able to stream profile and keep compression on client side.
If you have compression licensed on LTM, you could enable it in a custom HTTP profile. LTM would apply the stream profile/iRule first and then compress the response content.