Forum Discussion
James_Yang_9981
Altostratus
Nov 20, 2007remove accept-encoding header on WAM 4500
I'm currently implement WA 4500 in customer's envionment, their server has enabled compress. after WA online, I think it's better to disable server compress that will cause WA use more CPU power to decompress the content and compress it again. for failover issue, customer doesn't want to disable compress on OWS. So, the best way to do it is remove the accept-encoding header when WA send request to OWS.
the problem I meet is when I using the following rules:
when HTTP_REQUEST_SEND {
if {[HTTP::header exists "Accept-Encoding"]}{
HTTP::header remove "Accept-Encoding"
}
}
it will not work at all, error message is:
Nov 20 18:34:25 tmm tmm[7847]: 01220001:3: TCL error: removeencoding - Illegal argument. Can't execute in the current context. (line 1) invoked from within "HTTP::header exists "Accept-Encoding""
if I change the event to HTTP_REQUEST, it will work but client received the uncompressed response data.
from the wiki document, HTTP::header is supported in HTTP_REQUEST_SEND event.
any idea?
Thanks
4 Replies
- hoolio
Cirrostratus
Hi,
You can use the HTTP::header commands in the HTTP_REQUEST_SEND event if you force their evaluation in the clientside context (Click here).when HTTP_REQUEST_SEND { clientside { if {[HTTP::header exists "Accept-Encoding"]}{ HTTP::header remove "Accept-Encoding" } } }
or:when HTTP_REQUEST_SEND { if {clientside {HTTP::header exists "Accept-Encoding"}}{ clientside {HTTP::header remove "Accept-Encoding"} } }
Aaron - James_Yang_9981
Altostratus
Thanks response, but it doesn't work and just like remove the header in HTTP_REQUEST event.
At last, under ENE support. I got the function working by following rules:when HTTP_REQUEST { if {[HTTP::header exists "X-PvMAC"]} { if {[HTTP::header exists "Accept-Encoding"]}{ HTTP::header remove "Accept-Encoding" } } } - hoolio
Cirrostratus
If you don't need to use the HTTP_REQUEST_DATA event, that method is cleaner. I have successfully tested using the clientside command with HTTP::header commands in the HTTP_REQUEST_DATA event though. Maybe the issue is something new with 9.4.2 or 9.4.3?
Anyhow, it's good to hear you got it working.
Aaron - James_Yang_9981
Altostratus
not sure, may because of the internal VS of WA.
the request in an 9.x WA will be like this:
request->vs->tmm->pvac->internal vs->tmm->server
so the event will be hit twice. even serverside event was executed when tmm send traffic to pvac. that may cause the client header accept-encoding was removed. so when pvac accept the request, it has no accept-encoding header in the request, that pvac will not compress the content when it receive the server response.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
